Appearance and Behavior in WinForms CheckBox
18 Nov 20181 minute to read
This section discusses the appearance and behavior settings of the WinForms CheckBox control.
Appearance Settings
DrawFocusRectangle
You can show or hide the focus rectangle of the WinForms CheckBox control using the DrawFocusRectangle property.
| WinForms CheckBox Property | Description |
|---|---|
| DrawFocusRectangle | Determines whether the focus rectangle is visible when the control gets the focus. The default value is set to `True`. |
this.checkBoxAdv1.DrawFocusRectangle = true;Me.checkBoxAdv1.DrawFocusRectangle = True
Behavior Settings
The behavior of the WinForms CheckBox control can be customized using the AutoHeight, ReadOnlyMode, and Tristate properties.
| WinForms CheckBox Properties | Description |
|---|---|
| AutoHeight | Determines if the WinForms CheckBox will automatically calculate its height. |
| ReadOnlyMode | Specifies the Read Only Mode of the WinForms CheckBox. |
| Tristate | Specifies whether the indeterminate state can be accessed through clicking. |
this.checkBoxAdv1.AutoHeight = true;
this.checkBoxAdv1.ReadOnlyMode = true;
this.checkBoxAdv1.Tristate= false;Me.checkBoxAdv1.AutoHeight = True
Me.checkBoxAdv1.ReadOnlyMode = True
Me.checkBoxAdv1.Tristate= False