CheckBox.CheckAlign プロパティ
アセンブリ: 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 です。


次のコード例では、ラベル内の 3 つのプロパティの値を示します。ThreeState プロパティは、コントロールをクリックするごとに、true と false の間で切り替わります。また CheckAlign の ContentAlignment 値は、MiddleRight と MiddleLeft の間で切り替わります。この例では、ThreeState プロパティが変更され、コントロールがオンになった場合に、プロパティ値がどのように変化するかを示します。このコードでは、CheckBox、Label、および 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; } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からCheckBox.CheckAlign プロパティを検索する場合は、下記のリンクをクリックしてください。

- CheckBox.CheckAlign プロパティのページへのリンク