UserGuide

Web Check Box

From Xojo Documentation

Revision as of 21:49, 24 August 2020 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Use Check Boxes to let the user choose a preference. A Check Box can be checked, unchecked or indeterminate. Check Boxes should not cause an immediate and obvious action to occur except perhaps to enable or disable other controls.

Below are commonly used events and properties. Refer to WebCheckBox in the Language Reference for the complete list.

Events

ValueChanged

Called when the Check Box is clicked.

Properties

Caption

Used to set or change the caption text for the Check Box.

Value

True if the Check Box is checked, False if it is not checked.

Usage

To determine where the check box has been checked, you can test the Value property like this:

If AutoSaveCheck.Value = True Then
// Save data
End If

To perform an action when the user checks or unchecks the check box, put code in the ValueChanged event. This code enables a button when the check box is checked by the user:

If Me.Value Then
SaveButton.Enabled = True
Else
SaveButton.Enabled = False
End If

See Also

WebCheckBox class; UserGuide:Web UI topic