From Xojo Documentation

Revision as of 18:22, 23 July 2021 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Property (As String )
aDesktopCheckBox.Caption = newStringValue
StringValue = aDesktopCheckBox.Caption

New in 2021r3

Supported for all project types and targets.

The caption of a checkbox.


This property can be set inside the IDE or programmatically.

To set an accelerator character, precede the character in the Caption with an ampersand. In order to show an ampersand in the Caption, use two ampersands in a row.

Sample Code

This code sets the caption of the control to "OK".

Me.Caption = "OK"

This code in the Pressed event handler for a DesktopButton changes the text of the button each time it is clicked:

If Me.Caption = "Blue" Then
Me.Caption = "Red"
Me.Caption = "Blue"
End If