Vcl.Menus.TMenuItem.Items

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Items[Index: Integer]: TMenuItem read GetItem; default;

C++

__property TMenuItem* Items[int Index] = {read=GetItem/*, default*/};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Menus.pas
Vcl.Menus.hpp
Vcl.Menus TMenuItem

Description

Lists the menu items in the submenu of the menu item.

Use Items to access to a subitem by its position in the list of subitems. The value of Index is the position of the subitem within the Items array. For example, if an application has a File drop-down menu that contains the menu items New, Open, and Save, in that order, the expression



FileMenu.Items[2]



FileMenu->Items[2]



refers to the Save command.

Note: In Delphi, Items is the default property for TMenuItem. This means you can leave off the property name. Thus, instead of writing FileMenu.Items[2], you can write FileMenu[2].

Note: In C++, Items can be accessed using the [] operator, to achieve an affect similar to the default property in Delphi.

See Also

Code Examples