RadioButton.Checked Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the control is checked.
public:
property bool Checked { bool get(); void set(bool value); };
public bool Checked { get; set; }
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.SettingsBindable(true)]
public bool Checked { get; set; }
member this.Checked : bool with get, set
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.SettingsBindable(true)>]
member this.Checked : bool with get, set
Public Property Checked As Boolean
Property Value
true
if the check box is checked; otherwise, false
.
- Attributes
Examples
The following code example evaluates a ListBox selection and the Checked property of a RadioButton. When a specified item is selected from the list box, the PerformClick method of another RadioButton is called. 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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET