RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMenuItem.IndexOf Method

Returns the position of a menu item within the Items array.

Pascal
function IndexOf(Item: TMenuItem): Integer;
C++
__fastcall int IndexOf(TMenuItem Item);

Call IndexOf to locate a menu item in the submenu headed by this menu item. IndexOf returns 0 for the first menu item, 1 for the second menu item, and so on. If the menu item is not in the submenu, IndexOf returns -1.

Note: IndexOf may not correspond to the position of the item in the menu the user sees if the menu includes some items that are not visible.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!