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

定義

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

プロパティ値

有効な ContentAlignment 値の 1 つ。One of the valid ContentAlignment values. 既定値は MiddleLeft です。The default value is MiddleLeft.

例外

代入された値が、ContentAlignment 値ではありません。The assigned value is not one of the ContentAlignment values.

次のコード例は、実行CheckAlign時にプロパティを変更する方法を示しています。The following code example demonstrates how the CheckAlign property can be changed at run time. RadioButtonチェックボックス部分は、値がChecked変更されたときにテキストの右側または左側に移動されます。The check box portion of a RadioButton is moved to the right or left of the text when the Checked value changes. この例では、 RadioButtonコントロールがフォーム上でインスタンス化されていて、 System.Drawing名前空間への参照が含まれている必要があります。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

適用対象