Caption Property

Applies to TestComplete 15.20, last modified on January 13, 2022

Specifies the component’s caption text.

Declaration

componentObj.Caption
Read-Write Property String
componentObj     One of the user forms components or objects listed in the Applies To section  

Applies To

This property applies to the following components and objects:

TcxButton, TcxCheckBox, TcxCheckBoxProperties, TcxGroupBox, TcxLabel, TcxRadioGroup, TPanel, TSelectDirectory

Description

The meaning of the Caption property depends on which object it is applied to.

TcxButton.Caption, TcxCheckBox.Caption, TcxCheckBoxProperties.Caption, TcxGroupBox.Caption, TcxLabel.Caption, TcxRadioGroup.Caption, TPanel.Caption

Use the Caption property to get or set the caption of the component or object.

You can also use the Caption property to create the access key for the component. The access key is the underlined character in the component’s caption which lets the user perform the default action over the component (for example, click the button by pressing the combination of the ALT key and the access key on the keyboard). To specify an access key in the caption text, insert an ampersand (&) before the access character.

To include the ampersand in the caption text, use two ampersands (&&).

Property Value

A string holding the component’s caption text.

Remarks

The text displayed by the component is usually specified by the Caption or Text property. The difference between these properties is that Text is applied to components that allow editing its contents (for example, TcxTextEdit) and specifies the component contents, whereas Caption specifies the text used to label the component on the form (for example, caption of a button or a panel).

TSelectDirectory.Caption

The Caption property of the TSelectDirectory component specifies the text displayed above the folders tree in the dialog. You can use this property to supply the users with descriptive information on what folder they should select.

Property Value

The text displayed above the folders tree in the dialog. The default value is an empty string.

See Also

Text Property

Highlight search results