ContentAlignment Sabit listesi

Tanım

Çizim yüzeyinde içeriğin hizalamasını belirtir.

public enum class ContentAlignment
public enum ContentAlignment
type ContentAlignment = 
Public Enum ContentAlignment
Devralma
ContentAlignment

Alanlar

BottomCenter 512

İçerik alta dikey olarak, ortaya yatay olarak hizalanır.

BottomLeft 256

İçerik alta dikey olarak, sola yatay olarak hizalanır.

BottomRight 1024

İçerik alta dikey olarak ve sağa yatay olarak hizalanır.

MiddleCenter 32

İçerik dikey olarak ortaya, yatay olarak ortaya hizalanır.

MiddleLeft 16

İçerik, ortaya dikey olarak hizalanır ve sola yatay olarak hizalanır.

MiddleRight 64

İçerik dikey olarak ortaya ve yatay olarak sağa hizalanır.

TopCenter 2

İçerik en üste dikey olarak, ortaya yatay olarak hizalanır.

TopLeft 1

İçerik üst tarafa dikey olarak, sola yatay olarak hizalanır.

TopRight 4

İçerik üstte dikey olarak ve sağa yatay olarak hizalanır.

Örnekler

Aşağıdaki kod örneği, ve Size oluşturucularının ve numaralandırmasının System.Drawing.ContentAlignment nasıl kullanılacağını Point.Point gösterir. Bu örneği çalıştırmak için bu kodu adlı Label1 bir etiket içeren bir Windows Formuna yapıştırın ve formun InitializeLabel1 oluşturucusunda yöntemini çağırın.

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.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";
}
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

Şunlara uygulanır