Sign in Join
FPDoc Onlineexperiment

TMenuItem.IndexOfCaption function

Member of TMenuItempublicIn unit Menus

Gets the ordinal position in Items for the menu item with the specified Caption.

Declaration

pascal
function IndexOfCaption(const ACaption: string): Integer; virtual

Arguments

ACaption

Caption text to locate in the child Items for the menu item.

Function result

Ordinal position for the menu item with the given caption, or -1 when not found.

Description

IndexOfCaption visits the TMenuItem instances in the Items property to locate the menu item with the Caption specified in ACaption. Case is significant when comparing the value in ACaption to the menu item(s).

The return value contains the ordinal position in Items for the menu item with the specified caption, or -1 when a menu item is not found.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.