From Xojo Documentation


New in 2009r1

Used to set or get the State property of a CheckBox or the CellState property of a Checkbox cell in a ListBox.


The CheckedStates enum has the following values:

Value Constant
0 Unchecked
1 Checked
2 Indeterminate


A Checkbox can take on three values. You can get or set these values via the State property. To set the State property, use code such as this:

Checkbox1.State = Checkbox.CheckedStates.Checked

To get the state, read the value of the State property. For example,

TextField1.Text = Str(CheckBox1.State)

Setting the State automatically updates the CheckBox's Value property.

A Checkbox cell in a ListBox is managed via the CellState method. You assign a value using the CheckedStates enum. For example, the following code checks the cell's checkbox.

ListBox1.CellState(1, 0) = Checkbox.CheckedStates.Checked

See Also

CheckBox, ListBox controls; Enumeration data type