Caption Property
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Descriptive text that appears on an object to identify or describe it.
Syntax
object.Caption [= String]
The Caption property syntax has these parts:
Part | Description |
---|---|
object | Required. A valid object. |
String | Optional. A string expression that evaluates to the text displayed as the caption. |
Settings
The default setting for a control is a unique name based on the type of control. For example, CommandButton1 is the default caption for the first command button in a form.
Remarks
The text identifies or describes the object with which it is associated. For buttons and labels, the Caption property specifies the text that appears in the control. For Page and Tab objects, it specifies the text that appears on the tab. For the Explorer object, it specifies the text that appears in the explorers title bar.
If a control's caption is too long, the caption is truncated. If a form's caption is too long for the title bar, the title is displayed with an ellipsis.
The ForeColor property of the control determines the color of the text in the caption.
Tip If a control has both the Caption and AutoSize properties, setting AutoSize to True automatically adjusts the size of the control to frame the entire caption.