CheckBox.CheckState Property


Gets or sets the state of the CheckBox.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member CheckState : CheckState with get, set

Property Value

Type: System.Windows.Forms.CheckState

One of the CheckState enumeration values. The default value is Unchecked.

Exception Condition

The value assigned is not one of the CheckState enumeration values.

If the ThreeState property is set to false, the CheckState property value can only be set to CheckState.Indeterminate in code and not by user interaction.

The following table describes the System.Windows.Forms.Appearance of the CheckBox control in its different states for the Normal and Button style control CheckBox.Appearance.





The CheckBox displays a check mark.

The control appears sunken.


The CheckBox is empty.

The control appears raised.


The CheckBox displays a check mark and is shaded.

The control appears flat.

The following code example displays the values of three properties in a label. The ThreeState property alternates between true and false with alternating clicks of the control and the CheckAlign alternates between the MiddleRight and MiddleLeft values of System.Drawing.ContentAlignment. This example shows how the property values change as the ThreeState property changes and the control is checked. This example requires that a CheckBox, Label and Button have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the System.Drawing namespace. This code should be called in the Click event handler of the control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top