Show: Delphi C++
Display Preferences

Vcl.StdCtrls.TButton.Caption

From XE2 API Documentation
Jump to: navigation, search

Delphi

property Caption;

C++

__property Caption;

Contents

Properties

Type Visibility Source Unit Parent
property published
Vcl.StdCtrls.pas
Vcl.StdCtrls.hpp
Vcl.StdCtrls TButton

Description

Specifies a text string that identifies the control to the user.

Vcl.StdCtrls.TButton.Caption inherits from Vcl.Controls.TControl.Caption. All content below this line refers to Vcl.Controls.TControl.Caption.

Specifies a text string that identifies the control to the user.

Use Caption to specify the text string that labels the control.

To underline a character in a Caption that labels a component, include an ampersand (&) before the character. This type of character is called an accelerator character. The user can then select the component by pressing ALT while typing the underlined character. To display an ampersand character in the caption, use two ampersands (&&).

Note: Controls that display text use either the Caption property or the Text property to specify the text value. The property that is used depends on the type of control. In general, Caption is used for text that appears as a window title or label, while Text is used for text that appears as the content of a control.
Note: For some controls, such as TButton, it is not possible to change the color of the Caption. If you want to change the color of a button caption, you should use an alternate button type such as TSpeedButton or TBitBtn instead of TButton. With either TSpeedButton or TBitBtn, you can change the color of the Caption property by using the Font property.

See Also

Code Examples


Personal tools
Previous Versions
Translations