[Overview][Constants][Types][Classes][Procedures and functions][Index] |
The text displayed for the control.
Source position: stdctrls.pp line 1626
Caption is a TCaption property with the text displayed for the control. By default, Caption has the same value as the Name property used for the control. An explicit value can be assigned at design-time using the Object Inspector, or by the developer in program code.
Caption can be used to display an accelerator (or shortcut) key which allows an associated control to be given focus or executed. The shortcut key is identified by placing an Ampersand (&) character in front of the character used as the accelerator key. Use two Ampersand characters to display a single Ampersand which is not a shortcut key.
Set ShowAccelChar to False to disable display and use of the accelerator key in the control. This also allows Caption to display an Ampersand (&) character without escaping its value.
Use FocusControl to specify the control which is focused/activated when the accelerator key is detected and ShowAccelerator is enabled.
Set values in Font to specify the typeface, size, color, and style used to display the Caption text. Use Color to set the background color for the control.
For example:
{ var ALabel: TLabel; Form1: TForm; Memo1: TMemo; } ALabel.ShowAccelerator := True; ALabel.FocusControl := Memo1; ALabel.Caption := '&Notes && Comments';
Displays the 'N' character with an underline indicating the accelerator key. Pressing Alt+N activates the shortcut key and causes the associated TMemo control to be given focus.
|
Underlines the character in the label that acts as the accelerator or short cut key. |
|
|
The control associated with the label and its accelerator key (AccelChar). |
|
|
Contains the color used for the background on the control. |
|
|
The font to be used for text display in this control. |
|
|
Vertical alignment for control text (at the top, bottom, or center). |
|
|
The text displayed for the control. |
Version 3.2 | Generated 2024-02-25 | Home |