MenuItem::DefaultItem Property
.NET Framework (current version)
Gets or sets a value indicating whether the menu item is the default menu item.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if the menu item is the default item in a menu; otherwise, false. The default is false.
The default menu item for a menu is boldfaced. When the user double-clicks a submenu that contains a default item, the default item is selected, and the submenu is closed. You can use the DefaultItem property to indicate, the default action that is expected in a menu or shortcut menu.
The following code example creates a menu item with two submenu items. The example sets menuItem2 as the default menu item using the DefaultItem property.
.NET Framework
Available since 1.1
Available since 1.1
Show: