Caption property
Returns or sets the text that is displayed in an object. This is the default property for the Text object. Read/write. String.
When a caption is changed, the width of the field automatically changes to accommodate the changed number of characters. The font size is unchanged.
Multiple lines of text are separated with a carriage return-linefeed character combination (vbCrLf = Chr(13) + Chr(10)).
Syntax
object
.Caption
[ = string
]where
object
– is the name of a graphic object, or an expression that evaluates to a graphic object.string
– is a text string that will be displayed in the object.Remarks
- For a Display object, Caption only returns or sets the text in the title bar. It does not resize the title bar and multiple lines are not allowed.
- For a Button object, the size does not change to accommodate more characters. Any character beyond the width of the button are not displayed. Since the text is centered, text strings that are longer than the width of the button are truncated at both ends.
Provide Feedback