CheckBox.Value

From Xojo Documentation

Revision as of 16:14, 28 January 2020 by PLefebvre (talk | contribs) (Notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Property (As Boolean )
aCheckbox.Value = newBooleanValue
or
BooleanValue = aCheckbox.Value

Supported for all project types and targets.

The boolean value of the checkbox. Setting it to True sets it to checked and False sets it to unchecked.

Notes

As of 2009r1, the CheckBox is a tri-state control. Changing the VisualState property automatically changes the Value property. Changing the VisualState to Checked or Indeterminate automatically changes the Value to True if it isn't already. See the State property and the CheckedStates enum for more information. The Action event fires when the Value property is changed.

Sample Code

This code is in the Action event of the control and displays a message box each time the Checkbox is clicked. It reports on whether the the click changes it from True to False or vice-versa.

If Me.Value Then
MessageBox("CheckBox is checked")
Else
MessageBox("Checkbox is unchecked")
End If