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

TMenuItem.Caption

The caption text displayed for the menu item.

Declaration

Source position: menus.pp line 325

published property TMenuItem.Caption : TTranslateString
  read FCaption
  write SetCaption
  stored IsCaptionStored;

Description

Caption is a TTranslateString property which contains the text displayed for the menu item. Caption can include a prefixed character which is used as the accelerator key for the menu item. Use the value in cHotkeyPrefix to identify the character used as accelerator for the menu item. The accelerator key is drawn at run-time using the style implemented for a specific widgetset; this generally involves highlighting and/or underlining the accelerator key.

For example:

AMenuItem.Caption := cHotkeyPrefix + 'Open'; // or
AMenuItem.Caption := '&Open';

Changing the value in the property causes the widgetset class to be notified when the Handle has been allocated and the Parent property is assigned.

See also

cHotkeyPrefix

  

Prefix used in a menu item caption to identify a hot key (accelerator).

TTranslateString

  

Alias for the String type.


Version 4.0 Generated 2025-05-03 Home