Visual Basic Reference

Caption Property (ActiveX Controls)

See Also   Example   Applies To

Returns or sets the caption of an object.

Syntax

object.Caption [= string]

The Caption property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list. If object is omitted, the form associated with the active form moduleis assumed to be object.
string A string expression that evaluates to the text displayed as the caption.

Remarks

You can use the Caption property to assign an access key to a control. In the caption, include an ampersand (&) immediately preceding the character you want to designate as an access key. The character is underlined. Press the ALT key plus the underlined character to move the focus to that control. To include an ampersand in a caption without creating an access key, include two ampersands (&&). A single ampersand is displayed in the caption and no characters are underlined.