Share via


Using Check Boxes

You can use check boxes to make it possible for a user to specify a Boolean state: True or False, On or Off, Open or Closed. However, there are times when it isn't accurate to evaluate something as True or False, such as unanswered questions on a True/False questionnaire.

To see examples of using check boxes

  1. Run Solution.app in the Visual FoxPro \Samples\Solution directory.
  2. In the tree view, click Controls, and then click Check boxes.

There are four possible states for a check box, as determined by the Value property.

Display Value property
0 or .F.
1 or .T.
2
.NULL.

The Value property of the check box reflects the data type of the last assignment. If you set the property to true (.T.) or false (.F.), the type is Logical until you set the property to a numeric value.

Tip   A user can display a null value in a check box by pressing CTRL+0.

Storing or Displaying Logical Fields

If you set the ControlSource property of the check box to a logical field in a table, the check box is displayed as checked when the value in the current record is true (.T.), as not checked when the value in the current record is false (.F.), and as grayed when a null value (.NULL.) is in the current record.

See Also

Adding Pictures to Items in a List | Accepting Input That Cannot Be Predetermined | Using the InputMask Property | Using Controls | Controls and Objects