Use a CheckBox to give the user an option, such as true/false or yes/no. The CheckBox control can display an image or text or both.
CheckBox and RadioButton controls have a similar function: they allow the user to choose from a list of options. CheckBox controls let the user pick a combination of options. In contrast, RadioButton controls allow a user to choose from mutually exclusive options.
The Appearance property determines whether the CheckBox appears as a typical CheckBox or as a button.
The ThreeState property determines whether the control supports two or three states. Use the Checked property to get or set the value of a two-state CheckBox control and use the CheckState property to get or set the value of a three-state CheckBox control.
Note: |
|---|
If the
ThreeState property is set to true, the Checked property will return true for either a checked or indeterminate state.
|
The FlatStyle property determines the style and appearance of the control. If the FlatStyle property is set to FlatStyle..::.System, the user's operating system determines the appearance of the control.
The following describes an indeterminate state: You have a CheckBox that determines if the selected text in a RichTextBox is bold. When you select text you can click the CheckBox to bold the selection. Likewise, when you select some text, the CheckBox displays whether the selected text is bold. If your selected text contains text that is bold and normal, the CheckBox will have an indeterminate state.