CheckBox.AutoCheck Własność
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Pobiera lub ustawia wartość wskazującą, czy Checked wartości lub CheckState i CheckBoxwygląd są automatycznie zmieniane po kliknięciu CheckBox .
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
Wartość nieruchomości
true
Checked jeśli wartość lub CheckState wartość i wygląd kontrolki są automatycznie zmieniane w zdarzeniuClick; w przeciwnym razie false. Wartość domyślna to true.
Przykłady
Poniższy przykład kodu tworzy i inicjuje CheckBoxelement , daje mu wygląd przycisku przełącznika, ustawia wartość AutoCheckfalsei dodaje go do elementu Form.
public:
void InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
CheckBox^ checkBox1 = gcnew CheckBox;
// Make the check box 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.
this->Controls->Add( checkBox1 );
}
public void InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
CheckBox checkBox1 = new CheckBox();
// Make the check box 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.
Controls.Add(checkBox1);
}
Public Sub InstantiateMyCheckBox()
' Create and initialize a CheckBox.
Dim checkBox1 As New CheckBox()
' Make the check box 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.
Controls.Add(checkBox1)
End Sub
Uwagi
Jeśli AutoCheck ustawiono wartość false, należy dodać kod, aby zaktualizować Checked wartości lub CheckState w procedurze obsługi zdarzeń Click .