xtd 0.2.0
Loading...
Searching...
No Matches

◆ menu_item() [26/26]

xtd::forms::menu_item::menu_item ( const xtd::string text,
const std::vector< menu_item_ref > &  items 
)

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

Parameters
textThe caption for the menu item.
itemsAn array of menu_item objects that contains the submenu items for this menu item.
Remarks
When you specify a caption for your menu item with the text parameter, you can also specify an access key by placing an '&' before the character to be used as the access key. For example, to specify the "F" in "File" as an access key, you would specify the caption for the menu item as "&File". You can use this feature to provide keyboard navigation for your menus.
Setting the text parameter to "-" causes your menu item to be displayed as a separator (a horizontal line) rather than a standard menu item.
The items parameter enables you to assign an array of menu items to define a submenu of this menu item. Each item in the array can also have an array of menu items assigned to it. This enables you to create complete menu structures and assign them to the constructor for the menu item.