Share via


RadioButton.PerformClick 메서드

정의

클릭하는 동작을 시뮬레이션하는 컨트롤의 Click 이벤트를 생성합니다.

public:
 void PerformClick();
public void PerformClick ();
member this.PerformClick : unit -> unit
Public Sub PerformClick ()

예제

다음 코드 예제에서는 ListBox 선택 및 Checked 의 속성을 평가 합니다 RadioButton. 목록 상자에서 지정된 항목을 선택하면 다른 RadioButton 항목의 PerformClick 메서드가 호출됩니다. 이 예제에서는 폼에서 두 개의 RadioButton 컨트롤과 을 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

적용 대상

추가 정보