After launching the application, you will see a window displayed with a similar appearance to the one above. The main window contains a main menu with two entries (File and Format).
The main window also has a blue LABEL that contains a context menu, that is the clone of "Format" in the main menu. Right click on the LABEL and a context menu will appear
Under the Hood
This application shows how to create a main menu and how to associate a context menu to a control (here to a LABEL). More information regarding the use of menus, is available here .
This sample uses the following classes:
This sample is translated from the example located in the QuickStart\winforms\samples\menus subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio.NET.