Using Menus

An essential component of the Windows user interface is the use of menus. Menus that are typically located in the top of the application window allow a context-sensitive user interaction mechanism for a broader functionality. Menus are typically hierarchical, and the menu hierarchies provide the user a large number of possible actions in a very compact user interface. Adding a menu to Windows Forms is as simple as setting the Menu property to a MainMenu object (Listing 7.7, Figure 7.11). The MainMenu instance itself can contain a hierarchy of MenuItem instances. MenuItem can have a set of event handlers assigned to provide the required user interaction. Also note that menu items that contain the ampersand (&) character also have an ...

Get Microsoft® .NET Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.