RadioButton.CheckAlign RadioButton.CheckAlign RadioButton.CheckAlign RadioButton.CheckAlign Property

Definición

Obtiene o establece la ubicación de la parte de casilla de verificación de la RadioButton.Gets or sets the location of the check box portion of the RadioButton.

public:
 property System::Drawing::ContentAlignment CheckAlign { System::Drawing::ContentAlignment get(); void set(System::Drawing::ContentAlignment value); };
[System.ComponentModel.Bindable(true)]
public System.Drawing.ContentAlignment CheckAlign { get; set; }
member this.CheckAlign : System.Drawing.ContentAlignment with get, set
Public Property CheckAlign As ContentAlignment

Valor de propiedad

Uno válido de ContentAlignment valores.One of the valid ContentAlignment values. El valor predeterminado es MiddleLeft.The default value is MiddleLeft.

Excepciones

El valor asignado no es uno de los valores de ContentAlignment.The assigned value is not one of the ContentAlignment values.

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

Se aplica a