RadioButton.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

속성 값

Boolean

확인란이 선택되어 있으면 true이고, 그렇지 않으면 false입니다.

특성

예제

다음 코드 예제에서는 ListBox 선택 영역 및 Checked 의 속성을 평가 합니다 RadioButton. 목록 상자 PerformClick 에서 지정된 항목을 선택하면 다른 RadioButton 항목의 메서드가 호출됩니다. 이 예제에서는 폼에서 두 개의 RadioButton 컨트롤과 a ListBox 를 인스턴스화해야 합니다.

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

적용 대상