Skip to content

SetCaption

Samuel Gomes edited this page Feb 12, 2024 · 2 revisions

The SetCaption method changes a control's caption and parses for hot-key indicators.

Syntax:

SetCaption ControlID, "Caption"

Example:

SetCaption Button1, "&OK"

The ampersand symbol (&) is used to indicate that the following letter is going to be used as a hot-key, meaning that the user will be able to hold Alt and press the letter to activate this control.

You can use \n to add a line break in a caption and it'll be replaced with a CHR$(10). Line breaks work with Label and Progress bar controls that have the WordWrap property set to True.

Notes

The SetCaption method can be bypassed altogether as you can manipulate the Caption array directly, but by doing so the hot-key indicators and \n symbols won't be parsed.

Caption(Button1) = "Your caption"
Clone this wiki locally