CheckBox
From Xojo Documentation
The standard checkbox control used by desktop apps.
- For web apps, see WebCheckBox.
Properties | ||||||||||||||||||||||||||||||||||||
|
Methods | |||||||||
|
Enumerations | |
|
Notes
Checkboxes can have three states:
The Caption text does not wrap. |
Sample Code
The following code in the CheckBox's Action event handler checks the value of the CheckBox:
Because Checkbox is a three-state control, you can use the VisualState property to get and set its value. The CheckBox.VisualStates Enumeration is designed to get and set the values.
The following code sets the VisualState property of a CheckBox to Indeterminate.
Because VisualState is an Enumeration, you cannot use the corresponding Integer value for comparison. The following code shows how to use State in a Select Case statement:
Case CheckBox.VisualStates.Unchecked
// The CheckBox is unchecked
Case CheckBox.VisualStates.Checked
// The CheckBox is checked
Case CheckBox.VisualStates.Indeterminate
// The CheckBox state is indeterminate
End Select
See the entries for VisualState and Value for additional examples of setting and getting CheckBox values. See also the CheckBox.VisualStates Enumeration.
See Also
RadioButton control