Controls
Menus and Menu Items

Another
standard in Windows applications is the presence of a menu at the top. This
menu often has File, Edit, and Help menu items. You can add a menu by dropping
a MainMenu control (an instance of System.Windows.Forms.MainMenu) onto your
form. The Forms Designer provides a graphical method for you to add
hierarchical menu items. Behind the scenes, menu items are programmatically
added to the MainMenu control's MenuItems collection.

To create a shortcut key, where the user can type ALT + KEY instead of clicking
the menu item, add an ampersand (&) before the letter in the menu item text
that you want to use as a shortcut key. For example, if you want ALT + H as a
shortcut for a menu called Help, set the Text property to &Help.
The following table describes some of the properties that can be set for a
MenuItem, either graphically through the properties menu in Visual Studio, or
programmatically.
| Property |
Description |
| Checked |
Gets or sets a value indicating whether a check mark appears next to the text
of the menu item. |
| DefaultItem |
Gets or sets a value indicating whether the menu item is the default menu item. |
| Enabled |
Gets or sets a value indicating whether the menu item is enabled. |
| MdiList |
Gets or sets a value indicating whether the menu item will be populated with a
list of the Multiple Document Interface (MDI) child windows that are displayed
within the associated form. |
| MergeOrder |
Gets or sets a value indicating the relative position of the menu item when it
is merged with another. |
| MergeType |
Gets or sets a value indicating the behavior of this menu item when its menu is
merged with another. |
| RadioCheck |
Gets or sets a value indicating whether the MenuItem, if checked,
displays a radio-button instead of a check mark. |
| Shortcut |
Gets or sets a value indicating the shortcut key associated with the menu item. |
| ShowShortcut |
Gets or sets a value indicating whether the shortcut key that is associated
with the menu item is displayed next to the menu item caption. |
| Text |
Gets or sets a value indicating the caption of the menu item. |
| Visible |
Gets or sets a value indicating whether the menu item is visible. |
[Taken from .NET Documentation]
The MenuItem class has a Click event that you can handle to provide the necessary logic for
when a user clicks the menu item.
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
...
private void menuItem2_Click(object sender, System.EventArgs e)
{
}