ContentAlignment Výčet
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Určuje zarovnání obsahu na ploše výkresu.
public enum class ContentAlignment
public enum ContentAlignment
type ContentAlignment =
Public Enum ContentAlignment
- Dědičnost
Pole
BottomCenter | 512 | Obsah je svisle zarovnán v dolní části a vodorovně zarovnán na střed. |
BottomLeft | 256 | Obsah je svisle zarovnán v dolní části a vodorovně zarovnán nalevo. |
BottomRight | 1024 | Obsah je svisle zarovnán v dolní části a vodorovně zarovnán doprava. |
MiddleCenter | 32 | Obsah je svisle zarovnán uprostřed a vodorovně zarovnán na střed. |
MiddleLeft | 16 | Obsah je svisle zarovnán uprostřed a vodorovně zarovnán nalevo. |
MiddleRight | 64 | Obsah je svisle zarovnán uprostřed a vodorovně zarovnán doprava. |
TopCenter | 2 | Obsah je svisle zarovnán v horní části a vodorovně zarovnán na střed. |
TopLeft | 1 | Obsah je svisle zarovnán v horní části a vodorovně zarovnán nalevo. |
TopRight | 4 | Obsah je svisle zarovnán v horní části a vodorovně zarovnán doprava. |
Příklady
Následující příklad kódu ukazuje použití Point.Point a Size konstruktory a výčtu System.Drawing.ContentAlignment . Chcete-li spustit tento příklad, vložte tento kód do Windows Formulář, který obsahuje popisek s názvem Label1
a volání InitializeLabel1
metody v konstruktoru formuláře.
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