RadioButton.CheckedChanged 이벤트

정의

Checked 속성 값이 변경되면 발생합니다.

public:
 event EventHandler ^ CheckedChanged;
public event EventHandler CheckedChanged;
public event EventHandler? CheckedChanged;
member this.CheckedChanged : EventHandler 
Public Custom Event CheckedChanged As EventHandler 

이벤트 유형

EventHandler

예제

다음 코드 예제에서는 런타임에 CheckAlign 속성을 변경할 수 있는 방법을 보여 줍니다. 값이 변경되면 텍스트의 RadioButton 확인란 부분이 텍스트 Checked 의 오른쪽 또는 왼쪽으로 이동합니다. 이 예제에서는 폼에서 RadioButton 컨트롤을 인스턴스화하고 네임스페이스에 대한 참조를 System.Drawing 포함해야 합니다.

private:
   Void radioButton1_CheckedChanged( System::Object^ sender,
      System::EventArgs^ e )
   {
      // Change the check box position to be opposite its current position.
      if ( radioButton1->CheckAlign == ContentAlignment::MiddleLeft )
      {
         radioButton1->CheckAlign = ContentAlignment::MiddleRight;
      }
      else
      {
         radioButton1->CheckAlign = ContentAlignment::MiddleLeft;
      }
   }
private void radioButton1_CheckedChanged(Object sender, 
                                         EventArgs e)
{
   // Change the check box position to be opposite its current position.
   if (radioButton1.CheckAlign == ContentAlignment.MiddleLeft)
   {
      radioButton1.CheckAlign = ContentAlignment.MiddleRight;
   }
   else
   {
      radioButton1.CheckAlign = ContentAlignment.MiddleLeft;
   }
}
Private Sub radioButton1_CheckedChanged(sender As Object, e As EventArgs)
    ' Change the check box position to be opposite its current position.
    If radioButton1.CheckAlign = ContentAlignment.MiddleLeft Then
        radioButton1.CheckAlign = ContentAlignment.MiddleRight
    Else
        radioButton1.CheckAlign = ContentAlignment.MiddleLeft
    End If
End Sub

설명

이벤트 처리에 대한 자세한 내용은 이벤트 처리 및 발생 을 참조하십시오.

적용 대상

추가 정보