RadioButton.CheckedChanged Událost

Definice

Nastane, když se změní hodnota Checked vlastnosti.

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

Event Type

EventHandler

Příklady

Následující příklad kódu ukazuje, jak CheckAlign lze vlastnost změnit za běhu. Po změně hodnoty se část zaškrtávacího RadioButton políčka přesune do pravého nebo levého textu Checked . Tento příklad vyžaduje vytvoření RadioButton instance ovládacího prvku ve formuláři a zahrnutí odkazu na System.Drawing obor názvů.

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

Poznámky

Další informace o zpracování událostí najdete v tématu Zpracování a vyvolávání událostí.

Platí pro

Viz také