Dil

ContentAlignment Sabit listesi

Tanım

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

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

Alanlar

Name Değer Description
TopLeft 1

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

TopCenter 2

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

TopRight 4

İçerik en üste dikey olarak, sağa yatay olarak hizalanır.

MiddleLeft 16

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

MiddleCenter 32

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

MiddleRight 64

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

BottomLeft 256

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

BottomCenter 512

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

BottomRight 1024

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

Örnekler

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