System.Windows.Forms.MenuItem Members

The members of System.Windows.Forms.MenuItem are listed below.

See Also: Inherited members from System.Windows.Forms.Menu

Public Constructors

Initializes a System.Windows.Forms.MenuItem with a blank caption.

Initializes a new instance of the System.Windows.Forms.MenuItem class with a specified caption for the menu item.

Initializes a new instance of the class with a specified caption and event handler for the MenuItem.Click event of the menu item.

Initializes a new instance of the class with a specified caption and an array of submenu items defined for the menu item.

Initializes a new instance of the class with a specified caption, event handler, and associated shortcut key for the menu item.

Initializes a new instance of the System.Windows.Forms.MenuItem class with a specified caption; defined event-handlers for the MenuItem.Click, MenuItem.Select and MenuItem.Popup events; a shortcut key; a merge type; and order specified for the menu item.

Public Properties

BarBreakbool.

Gets or sets a value indicating whether the System.Windows.Forms.MenuItem is placed on a new line (for a menu item added to a System.Windows.Forms.MainMenu object) or in a new column (for a submenu item or menu item displayed in a System.Windows.Forms.ContextMenu).

Breakbool.

Gets or sets a value indicating whether the item is placed on a new line (for a menu item added to a System.Windows.Forms.MainMenu object) or in a new column (for a menu item or submenu item displayed in a System.Windows.Forms.ContextMenu).

Checkedbool.

Gets or sets a value indicating whether a check mark appears next to the text of the menu item.

DefaultItembool.

Gets or sets a value indicating whether the menu item is the default menu item.

Enabledbool.

Gets or sets a value indicating whether the menu item is enabled.

Indexint.

Gets or sets a value indicating the position of the menu item in its parent menu.

[read-only]
override
IsParentbool.

Gets a value indicating whether the menu item contains child menu items.

MdiListbool.

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.

MergeOrderint.

Gets or sets a value indicating the relative position of the menu item when it is merged with another.

MergeTypeMenuMerge.

Gets or sets a value indicating the behavior of this menu item when its menu is merged with another.

[read-only]
Mnemonicchar.

Gets a value indicating the mnemonic character that is associated with this menu item.

OwnerDrawbool.

Gets or sets a value indicating whether the code that you provide draws the menu item or Windows draws the menu item.

[read-only]
ParentMenu.

Gets a value indicating the menu that contains this menu item.

RadioCheckbool.

Gets or sets a value indicating whether the System.Windows.Forms.MenuItem, if checked, displays a radio-button instead of a check mark.

ShortcutShortcut.

Gets or sets a value indicating the shortcut key associated with the menu item.

ShowShortcutbool.

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.

Textstring.

Gets or sets a value indicating the caption of the menu item.

Visiblebool.

Gets or sets a value indicating whether the menu item is visible.

Protected Properties

[read-only]
MenuIDint.

Gets a value indicating the Windows identifier for this menu item.

Public Methods

CloneMenu() : MenuItem

Creates a copy of the current System.Windows.Forms.MenuItem.

MergeMenu() : MenuItem

Merges this System.Windows.Forms.MenuItem with another System.Windows.Forms.MenuItem and returns the resulting merged System.Windows.Forms.MenuItem.

MergeMenu(MenuItem)

Merges another menu item with this menu item.

PerformClick()

Generates a Control.Click event for the System.Windows.Forms.MenuItem, simulating a click by a user.

PerformSelect()

Raises the MenuItem.Select event for this menu item.

override
ToString() : string

Returns a string that represents the System.Windows.Forms.MenuItem.

Protected Methods

CloneMenu(MenuItem)

Creates a copy of the specified System.Windows.Forms.MenuItem.

override
Dispose(bool)

Disposes of the resources (other than memory) used by the System.Windows.Forms.MenuItem.

OnClick(EventArgs)

Raises the MenuItem.Click event.

OnDrawItem(DrawItemEventArgs)

Raises the MenuItem.DrawItem event.

OnInitMenuPopup(EventArgs)

Raises the MenuItem.Popup event.

OnMeasureItem(MeasureItemEventArgs)

Raises the MenuItem.MeasureItem event.

OnPopup(EventArgs)

Raises the MenuItem.Popup event.

OnSelect(EventArgs)

Raises the MenuItem.Select event.

Public Events

Click

Occurs when the menu item is clicked or selected using a shortcut key or access key defined for the menu item.

DrawItem

Occurs when the MenuItem.OwnerDraw property of a menu item is set to true and a request is made to draw the menu item.

MeasureItem

Occurs when the menu needs to know the size of a menu item before drawing it.

Popup

Occurs before a menu item's list of menu items is displayed.

Select

Occurs when the user places the pointer over a menu item.