How do I keep .NET 4.6.2 WinForm MenuStrip visible on top of application workspace when using Visual Studio 2019 form designer?

DB17 21 Reputation points
2022-01-01T19:24:42.753+00:00

I have inherited some C# source code written in Visual Studio 2010 targeting the .NET 2.0 framework. It comprises a simple Windows Forms application with a single form as its user interface.

The form contains a number of menu items, one of which allows the user to preview an image (acquired from a camera). An example of the program output is shown below, with the dark rectangle being the image.

161694-h6lqa.png

I wish to rewrite the application from scratch for the .NET 4.6.2 Framework using Visual Studio 2019.

Recreating the form is straightforward. However, the component MenuItem used for .NET 2.0 in VS2010 has been replaced by MenuStrip and ToolStripMenuItem in VS2019. When I build the updated version of the application, I can't make the menu strip operate in the same way. My output looks as shown below when the application runs.

161732-2hhlz.png

As you can see, the top level menus are accessible but not visible. How can I locate the workspace image below the MenuStrip?

I am hoping that the answer will be some MenuStrip setting in Visual Studio's 'Properties' dialog box that I have overlooked.

Here are the ToolStripItem settings in Form1.Designer.cs

    // mainMenu1  
    //   
    this.mainMenu1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {  
    this.menuFile,  
    this.menuView,  
    this.menuSet,  
    this.menuDLL,  
    this.menuDevice});  
    this.mainMenu1.Location = new System.Drawing.Point(0, 0);  
    this.mainMenu1.Name = "mainMenu1";  
    this.mainMenu1.Size = new System.Drawing.Size(640, 24);  
    this.mainMenu1.TabIndex = 0;  
    this.mainMenu1.Text = "menuMenu1";  
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,850 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,362 questions
{count} votes

Accepted answer
  1. Castorix31 82,031 Reputation points
    2022-01-02T10:13:14.417+00:00

    How do you position the Capture window ?
    For example, if I use DirectShow and I call IVideoWindow.SetWindowPosition with y = 25 :

    161744-webcam-capture.jpg

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful