ContentAlignment-Enumeration
Gibt die Ausrichtung des Inhalts auf der Zeichenoberfläche an.
Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)
Syntax
'Declaration
Public Enumeration ContentAlignment
'Usage
Dim instance As ContentAlignment
public enum ContentAlignment
public enum class ContentAlignment
public enum ContentAlignment
public enum ContentAlignment
Member
Membername | Beschreibung | |
---|---|---|
BottomCenter | Der Inhalt wird vertikal am unteren Rand und horizontal zentriert ausgerichtet. | |
BottomLeft | Der Inhalt wird vertikal am unteren Rand und horizontal linksbündig ausgerichtet. | |
BottomRight | Der Inhalt wird vertikal am unteren Rand und horizontal rechtsbündig ausgerichtet. | |
MiddleCenter | Der Inhalt wird vertikal an der Mitte und horizontal zentriert ausgerichtet. | |
MiddleLeft | Der Inhalt wird vertikal an der Mitte und horizontal linksbündig ausgerichtet. | |
MiddleRight | Der Inhalt wird vertikal an der Mitte und horizontal rechtsbündig ausgerichtet. | |
TopCenter | Der Inhalt wird vertikal am oberen Rand und horizontal zentriert ausgerichtet. | |
TopLeft | Der Inhalt wird vertikal am oberen Rand und horizontal linksbündig ausgerichtet. | |
TopRight | Der Inhalt wird vertikal am oberen Rand und horizontal rechtsbündig ausgerichtet. |
Beispiel
Im folgenden Codebeispiel wird die Verwendung des System.Drawing.Point-Konstruktors und des Size-Konstruktors sowie der System.Drawing.ContentAlignment-Enumeration veranschaulicht. Fügen Sie zum Ausführen dieses Beispiels diesen Code in ein Windows Form ein, das ein Label-Steuerelement mit dem Namen Label1
enthält, und rufen Sie die IntializeLabel1
-Methode im Konstruktor des Formulars auf.
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
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
.NET Compact Framework
Unterstützt in: 2.0, 1.0