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

◆ menu_items() [1/3]

const menu_item_collection & xtd::forms::menu::menu_items ( ) const
noexcept

Gets a value indicating the collection of menu_item objects associated with the menu.

Returns
A menu::menu_item_collection that represents the list of menu_item objects stored in the menu.
Remarks
You can use this property to obtain a reference to the list of menu items that are currently stored in the menu. For main_menu and context_menu objects, the menu_items property contains the entire menu structure in the control. For the menu_item class, the menu_items property contains the list of submenu items associated with the menu_item. With the reference to the collection of menu items for the menu (provided by this property), you can add and remove menu items, determine the total number of menu items, and clear the list of menu items from the collection. For more information on maintaining the menu item collection for a menu, see the xtd::forms::menu::menu_item_collection documentation.