RadioButton.AutoCheck Özellik

Tanım

Denetim tıklatıldığında değerin Checked ve denetimin görünümünün otomatik olarak değişip değişmediğini belirten bir değer alır veya ayarlar.

public:
 property bool AutoCheck { bool get(); void set(bool value); };
public bool AutoCheck { get; set; }
member this.AutoCheck : bool with get, set
Public Property AutoCheck As Boolean

Özellik Değeri

true denetimin Checked değeri ve görünümü olayda Click otomatik olarak değişirse; değilse, false. true varsayılan değerdir.

Örnekler

Aşağıdaki kod örneği bir RadioButtonoluşturur ve başlatır, buna bir geçiş denetimi görünümü verir, özelliğini olarak falseayarlar AutoCheck ve bunu öğesine Formekler.

private void InitializeMyRadioButton()
{
   // Create and initialize a new RadioButton.
   RadioButton radioButton1 = new 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.
   Controls.Add(radioButton1);
}
Private Sub InitializeMyRadioButton()
    ' Create and initialize a new RadioButton. 
    Dim radioButton1 As New 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.
    Controls.Add(radioButton1)
End Sub

Açıklamalar

Checked Değer olarak falseayarlanırsa, denetimin RadioButton bir kısmı olay işleyicisindeki kodda Click iade edilmelidir. Ayrıca, bir denetim grubunun parçasıysa RadioButtonRadioButton , bu özellik belirli bir zamanda denetimlerden yalnızca birinin denetlenmesini sağlar.

AutoCheck özelliği olarak falseayarlanırsa, bir denetim grubu RadioButton birbirini dışlayan bir grup olarak çalışmaz ve özelliğin Checked kodda güncelleştirilmesi gerekir.

Şunlara uygulanır