This command adds a checkbox control to the window referenced by #handle.ext. Checkboxes have two states, set and reset. They are useful for getting input of on/off type information.

Here is a description of the parameters of the CHECKBOX statement:

#handle.ext

This parameter specifies the handle for this control. The #handle part should be the same as the handle of the window containing the checkbox, and the .ext part names the checkbox uniquely in the window.

"label"

This parameter contains the visible text of the checkbox

setHandler

This is the branch label or subroutine to go to when the user sets the checkbox by clicking on it. When the checkbox is "set" it displays a checkmark. See also: Controls and Events

resetHandler

This is the branch label or subroutine to goto when the user resets the checkbox by clicking on it. When the checkbox is "reset", the checkmark is removed. See also: Controls and Events

x

This is the x position of the checkbox relative to the upper left corner of the window it belongs to.

y

This is the y position of the checkbox relative to the upper left corner of the window it belongs to.

wide

This is the width of the checkbox control.

high

This is the height of the checkbox control.

Checkbox Commands

Checkboxes understand these commands:

print #handle.ext, "set"

This sets the checkbox, causing a checkmark to appear within it.

print #handle.ext, "reset"

This resets the checkbox, clearing it.

print #handle.ext, "value? result$"

The result$ variable is set to the status of the checkbox (either "set" or "reset").

print #handle.ext, "setfocus"

This causes the checkbox to receive the input focus. This means that any keypresses are directed to the checkbox.

print #handle,ext, "locate x y width height"

This repositions the checkbox in its window. This is effective when the checkbox is placed inside window of type "window". The checkbox will not update its size and location until a REFRESHcommand is sent to the window. See the RESIZE.BAS example program.

print #handle, "font facename pointSize"

This sets the font to the specified face and point size. If an exact match cannot be found, then Liberty BASIC will try to find a close match, with size taking precedence over face. For more on specifying fonts read How to Specify Fonts