RadioButton.CheckedChanged RadioButton.CheckedChanged RadioButton.CheckedChanged RadioButton.CheckedChanged Event

Definición

Se produce cuando cambia el valor de la propiedad Checked.Occurs when the value of the Checked property changes.

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

Ejemplos

En el ejemplo de código siguiente se muestra cómo el CheckAlign propiedad se puede cambiar en tiempo de ejecución.The following code example demonstrates how the CheckAlign property can be changed at run time. La parte de casilla de verificación de un RadioButton se mueve hacia la derecha o izquierda del texto cuando el Checked cambia el valor.The check box portion of a RadioButton is moved to the right or left of the text when the Checked value changes. Este ejemplo requiere que un RadioButton se ha creado una instancia del control en un formulario y que una referencia a la System.Drawing se ha incluido el espacio de nombres.This example requires that a RadioButton control has been instantiated on a form and that a reference to the System.Drawing namespace has been included.

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

Comentarios

Para obtener más información sobre el manejo de eventos, consulte controlar y provocar eventos.For more information about handling events, see Handling and Raising Events.

Se aplica a

Consulte también: