ContentAlignmentとは? わかりやすく解説

ContentAlignment 列挙体

描画面でのコンテンツの配置方法を指定します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Dim instance As ContentAlignment
public enum ContentAlignment
public enum class ContentAlignment
public enum ContentAlignment
public enum ContentAlignment
メンバメンバ
使用例使用例

System.Drawing.Point コンストラクタと Size コンストラクタ、および System.Drawing.ContentAlignment 列挙体の使用方法を示すコード例を次に示します。この例を実行するには、Label1 という名前のラベルが配置され、フォームのコンストラクタで IntializeLabel1 メソッドを呼び出す Windows フォームにコードを貼り付けます。

Private Sub InitializeLabel1()

    ' Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle

    ' Set the size, constructing a size from two integers.
    Label1.Size = New Size(100, 50)

    ' Set the location, constructing a point from a 32-bit integer
    ' (using hexadecimal).
    Label1.Location = New Point(&H280028)

    ' Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight
    Label1.Text = "Bottom Right Alignment"
End Sub
private void InitializeLabel1()
{
    // Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle;

    // Set the size, constructing a size from two integers.
    Label1.Size = new Size(100, 50);

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    Label1.Location = new Point(0x280028);

    // Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight;
    Label1.Text = "Bottom Right Alignment";
}
void InitializeLabel1()
{
   // Set a border.
   Label1->BorderStyle = BorderStyle::FixedSingle;
   
   // Set the size, constructing a size from two integers.
   Label1->Size = System::Drawing::Size( 100, 50 );
   
   // Set the location, constructing a point from a 32-bit integer
   // (using hexadecimal).
   Label1->Location = Point(0x280028);
   
   // Set and align the text on the lower-right side of the label.
   Label1->TextAlign = ContentAlignment::BottomRight;
   Label1->Text = "Bottom Right Alignment";
}
private void Initializelabel1()
{
    // Set a border.
    label1.set_BorderStyle(BorderStyle.FixedSingle);

    // Set the size, constructing a size from two integers.
    label1.set_Size(new Size(100, 50));

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    label1.set_Location(new Point(0x280028));

    // Set and align the text on the lower-right side of the label.
    label1.set_TextAlign(ContentAlignment.BottomRight);
    label1.set_Text("Bottom Right Alignment");
} //Initializelabel1
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ContentAlignment 列挙体

メモ : この列挙体は、.NET Framework version 2.0 で新しく追加されたものです。

ウィンドウ キャプションにテキストをどのように配置するかを指定します。

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

Dim instance As ContentAlignment
public enum ContentAlignment
public enum class ContentAlignment
public enum ContentAlignment
public enum ContentAlignment
メンバメンバ
解説解説

ContentAlignment 値は、EnumProperty.ContentAlignment の引数値で呼び出された場合の VisualStyleRenderer.GetEnumValue メソッドの戻り値を表します。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
System.Windows.Forms.VisualStyles 名前空間



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「ContentAlignment」の関連用語

ContentAlignmentのお隣キーワード
検索ランキング

   

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



ContentAlignmentのページの著作権

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

©2026 GRAS Group, Inc.RSS