Normally a CheckBox is either checked or unchecked. You can catch the CheckedChanged event handler to learn when the control's value has changed and you can use its Checked property to get its current value.
A CheckBox can also display a third indeterminate state. For example, a program might use the three states to indicate that a group of options is selected (checked), not selected (unchecked), or some options are selected (indeterminate).
To do this, first set the ComboBox's ThreeState property to True. Next catch the control's CheckStateChanged event instead of CheckedChanged. In the event, use the control's CheckState property to see whether it is checked, unchecked, or indeterminate.
The following code shows how this example sets the lunch ComboBox's state to indeterminate when the program starts.
|