ContentAlignment Enumeração

Definição

Especifica o alinhamento do conteúdo na superfície de desenho.

public enum class ContentAlignment
public enum ContentAlignment
type ContentAlignment = 
Public Enum ContentAlignment
Herança
ContentAlignment

Campos

BottomCenter 512

O conteúdo está alinhado verticalmente à parte inferior e alinhado horizontalmente ao centro.

BottomLeft 256

O conteúdo está alinhado verticalmente à parte inferior e alinhado horizontalmente à esquerda.

BottomRight 1024

O conteúdo está alinhado verticalmente à parte inferior e alinhado horizontalmente à direita.

MiddleCenter 32

O conteúdo está alinhado verticalmente ao meio e alinhado horizontalmente ao centro.

MiddleLeft 16

O conteúdo está alinhado verticalmente ao meio e alinhado horizontalmente à esquerda.

MiddleRight 64

O conteúdo está alinhado verticalmente ao meio e alinhado horizontalmente à direita.

TopCenter 2

O conteúdo está alinhado verticalmente à parte superior e alinhado horizontalmente ao centro.

TopLeft 1

O conteúdo está alinhado verticalmente à parte superior e alinhado horizontalmente à esquerda.

TopRight 4

O conteúdo está alinhado verticalmente à parte superior e alinhado horizontalmente à direita.

Exemplos

O exemplo de código a seguir demonstra como usar os construtores e Size construtores Point.Point e a System.Drawing.ContentAlignment enumeração. Para executar este exemplo, cole esse código em um formulário de Windows que contém um rótulo nomeado Label1 e chame o InitializeLabel1 método no construtor do formulário.

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

Aplica-se a