Gets or sets a value indicating whether the Checked or CheckState value and the check box's appearance are automatically changed when it is clicked.
[Visual Basic] Public Property AutoCheck As Boolean [C#] public bool AutoCheck {get; set;} [C++] public: __property bool get_AutoCheck(); public: __property void set_AutoCheck(bool); [JScript] public function get AutoCheck() : Boolean; public function set AutoCheck(Boolean);
true if the Checked value or CheckState value and the appearance of the control are automatically changed on the OnClick event; otherwise, false. The default value is true.
If AutoCheck is set to false, you will need to write code to update the Checked or CheckState values in the OnClick event handler.
The following example instantiates a CheckBox, gives it the appearance of a toggle button and sets AutoCheck to false.
[Visual Basic]
' Instantiate a CheckBox. Private CheckBox1 As System.WinForms.CheckBox Private Sub MySub() ' Initialize a new CheckBox. Form1.CheckBox1 = New System.WinForms.CheckBox ' Make the checkbox control appear as a toggle button. CheckBox1.Appearance = Appearance.Button ' Turn off the update of the display on the click of the control. CheckBox1.AutoCheck = False ' Add the check box control to the form. Form1.Controls.Add(CheckBox1) End Sub
CheckBox Class | CheckBox Members | System.WinForms Namespace