Using CheckBoxes

CheckBoxes are square boxes used to set independent options. When a CheckBox is selected, it contains a check mark; when it is not selected, it is blank.

CheckBoxes are independent of each other. You can group them in a GroupBox or rectangle to make the window easier to understand and use, but that does not affect the CheckBoxes' behavior; they are still independent.

Figure 11-4: Multiple selections in a GroupBox

The sample is a group box with the label Show in its top left corner. It contains four vertically aligned check boxes respectively labeled Name, Department, Job Title, and Salary. The first three check boxes contain check marks to show they are selected. The last check box is blank.

Using three states

CheckBoxes usually have two states, on and off, but sometimes you want to represent a third state, such as Unknown. The third state displays as a grayed box with a check mark.

StepsTo enable the third state:

  1. Select the ThreeState property in the General page of the CheckBox Properties view

StepsTo specify that a CheckBox’s current state is the third state:

  1. Select the ThreeState and the ThirdState properties in the General page of the CheckBox Properties view