RadioButton.Checked Eigenschaft
Definition
Ruft einen Wert ab, der angibt, ob das Steuerelement aktiviert ist, oder legt diesen fest.Gets or sets a value indicating whether the control is checked.
public:
property bool Checked { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.SettingsBindable(true)]
public bool Checked { get; set; }
member this.Checked : bool with get, set
Public Property Checked As Boolean
Eigenschaftswert
true
, wenn das Kontrollkästchen aktiviert ist, andernfalls false
.true
if the check box is checked; otherwise, false
.
- Attribute
Beispiele
Im folgenden Codebeispiel werden eine ListBox Auswahl und die Checked -Eigenschaft RadioButtoneines ausgewertet.The following code example evaluates a ListBox selection and the Checked property of a RadioButton. Wenn ein bestimmtes Element im Listenfeld ausgewählt wird, wird die PerformClick -Methode eines RadioButton anderen aufgerufen.When a specified item is selected from the list box, the PerformClick method of another RadioButton is called. Für dieses Beispiel ist es RadioButton erforderlich, dass ListBox zwei-Steuerelemente und eine in einem Formular instanziiert wurden.This example requires that two RadioButton controls and a ListBox have been instantiated on a form.
private:
void ClickMyRadioButton()
{
// If Item1 is selected and radioButton2
// is checked, click radioButton1.
if ( listBox1->Text == "Item1" && radioButton2->Checked )
{
radioButton1->PerformClick();
}
}
private void ClickMyRadioButton()
{
// If Item1 is selected and radioButton2
// is checked, click radioButton1.
if (listBox1.Text == "Item1" && radioButton2.Checked)
{
radioButton1.PerformClick();
}
}
Private Sub ClickMyRadioButton()
' If Item1 is selected and radioButton2
' is checked, click radioButton1.
If (listBox1.Text = "Item1") And radioButton2.Checked Then
radioButton1.PerformClick()
End If
End Sub