DesktopButton.Caption

From Xojo Documentation

Property (As String )
aDesktopButton.Caption = newStringValue
or
StringValue = aDesktopButton.Caption

New in 2021r3

Supported for all project types and targets.

The caption of a control.

Notes

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 DesktopPushButton changes the text of the button each time it is pressed:

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