[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Menus' (#lcl)

TMenuItem.IndexOfCaption

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

Declaration

Source position: menus.pp line 270

public function TMenuItem.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

TMenuItem.Items

  

Provides indexed access to the child menu items for the current class instance.

TMenuItem.Caption

  

The caption text displayed for the menu item.


Version 3.2 Generated 2024-02-25 Home