CheckBox.CheckAlign プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > CheckBox.CheckAlign プロパティの意味・解説 

CheckBox.CheckAlign プロパティ

CheckBox コントロールにおけるチェック マーク平および垂直の配置取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<BindableAttribute(True)> _
<LocalizableAttribute(True)> _
Public Property CheckAlign As
 ContentAlignment
Dim instance As CheckBox
Dim value As ContentAlignment

value = instance.CheckAlign

instance.CheckAlign = value
[BindableAttribute(true)] 
[LocalizableAttribute(true)] 
public ContentAlignment CheckAlign { get; set;
 }
[BindableAttribute(true)] 
[LocalizableAttribute(true)] 
public:
property ContentAlignment CheckAlign {
    ContentAlignment get ();
    void set (ContentAlignment value);
}
/** @property */
public ContentAlignment get_CheckAlign ()

/** @property */
public void set_CheckAlign (ContentAlignment
 value)
public function get CheckAlign
 () : ContentAlignment

public function set CheckAlign
 (value : ContentAlignment)

プロパティ
ContentAlignment 値の 1 つ既定値MiddleLeft です。

例外例外
例外種類条件

InvalidEnumArgumentException

代入された値が、ContentAlignment 列挙値ではありません。

使用例使用例

次のコード例では、ラベル内の 3 つのプロパティの値を示します。ThreeState プロパティは、コントロールクリックするごとに、truefalse の間で切り替わります。また CheckAlignContentAlignment 値は、MiddleRightMiddleLeft の間で切り替わります。この例では、ThreeState プロパティ変更されコントロールオンになった場合に、プロパティ値がどのように変化するかを示します。このコードでは、CheckBoxLabel、および Buttonフォーム上ですべてインスタンス化されており、ラベルが 3 行のテキスト表示できる大きさあり、かSystem.Drawing 名前空間への参照追加されている必要があります。このコードは、コントロールClick イベント ハンドラ呼び出す必要があります

Private Sub AdjustMyCheckBoxProperties()
    ' Concatenate the property values together on three lines.
    label1.Text = "ThreeState: " & checkBox1.ThreeState.ToString()
 & ControlChars.Cr & _
        "Checked: " & checkBox1.Checked.ToString()
 & ControlChars.Cr & _
        "CheckState: " & checkBox1.CheckState.ToString()
    
    ' Change the ThreeState and CheckAlign properties on every other
 click.
    If Not checkBox1.ThreeState Then
        checkBox1.ThreeState = True
        checkBox1.CheckAlign = ContentAlignment.MiddleRight
    Else
        checkBox1.ThreeState = False
        checkBox1.CheckAlign = ContentAlignment.MiddleLeft
    End If
End Sub 'AdjustMyCheckBoxProperties
private void AdjustMyCheckBoxProperties()
 {
    // Concatenate the property values together on three lines.
    label1.Text = "ThreeState: " + checkBox1.ThreeState.ToString() + "\n"
 +
                  "Checked: " + checkBox1.Checked.ToString() + "\n"
 +
                  "CheckState: " + checkBox1.CheckState.ToString(); 
    
    // Change the ThreeState and CheckAlign properties on every other
 click.
    if (!checkBox1.ThreeState)
    {
       checkBox1.ThreeState = true;
       checkBox1.CheckAlign = ContentAlignment.MiddleRight;
    }
    else
    {
       checkBox1.ThreeState = false;
       checkBox1.CheckAlign = ContentAlignment.MiddleLeft;
    }
 }
 
private:
   void AdjustMyCheckBoxProperties()
   {
      // Concatenate the property values together on three lines.
      label1->Text = String::Format( "ThreeState: {0}\nChecked: {1}\nCheckState:
 {2}",
         checkBox1->ThreeState, checkBox1->Checked, checkBox1->CheckState
 );
      
      // Change the ThreeState and CheckAlign properties on every other
 click.
      if ( !checkBox1->ThreeState )
      {
         checkBox1->ThreeState = true;
         checkBox1->CheckAlign = ContentAlignment::MiddleRight;
      }
      else
      {
         checkBox1->ThreeState = false;
         checkBox1->CheckAlign = ContentAlignment::MiddleLeft;
      }
   }
private void AdjustMyCheckBoxProperties()
{
    // Concatenate the property values together on three lines.
    label1.set_Text("ThreeState: " + checkBox1.get_ThreeState() + "\n"
        + "Checked: " + checkBox1.get_Checked() + "\n" 
        + "CheckState: " + checkBox1.get_CheckState());

    //Change the ThreeState and CheckAlign properties on every other
 click.
    if (!(checkBox1.get_ThreeState())) {
        checkBox1.set_ThreeState(true);
        checkBox1.set_CheckAlign(ContentAlignment.MiddleRight);
    }
    else {
        checkBox1.set_ThreeState(false);
        checkBox1.set_CheckAlign(ContentAlignment.MiddleLeft);
    }
} //AdjustMyCheckBoxProperties
private function AdjustMyCheckBoxProperties()
 {
    // Concatenate the property values together on three lines.
    label1.Text = "ThreeState: " + checkBox1.ThreeState.ToString() + "\n"
 +
                  "Checked: " + checkBox1.Checked.ToString() + "\n"
 +
                  "CheckState: " + checkBox1.CheckState.ToString(); 
    
    // Change the ThreeState and CheckAlign properties on every other
 click.
    if (!checkBox1.ThreeState)
    {
       checkBox1.ThreeState = true;
       checkBox1.CheckAlign = ContentAlignment.MiddleRight;
    }
    else
    {
       checkBox1.ThreeState = false;
       checkBox1.CheckAlign = ContentAlignment.MiddleLeft;
    }
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

CheckBox.CheckAlign プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CheckBox.CheckAlign プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS