Gets or sets a value indicating whether the Checked value and the appearance of the control automatically change when the control 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 and the appearance of the control automatically change on the OnClick event; otherwise, false. The default value is true.
If the Checked value is set to false, the radio button portion of the control must be checked in code in the System.WinForms.RadioButton.Click event. In additon, if the RadioButton is part of a RadioButton control group, this property ensures that only one of the controls is checked at a given time.
The following example instantiates a RadioButton, gives it the appearance of a toggle button, and sets its AutoCheck property to false.
Private Sub MySub() ' Initialize a new RadioButton. Form1.RadioButton1 = New System.WinForms.RadioButton ' Make the radio button control appear as a toggle button. RadioButton1.Appearance = Appearance.Button ' Turn off the update of the display on the click of the control. RadioButton1.AutoCheck = False ' Add the radio button to the form. Form1.Controls.Add(RadioButton1) End Sub
RadioButton Class | RadioButton Members | System.WinForms Namespace