System.Windows.Forms.Label.TextAlign Property

Gets or sets the alignment of text in the label.

Syntax

[System.ComponentModel.Localizable(true)]
[System.ComponentModel.DefaultValue(System.Drawing.ContentAlignment.TopLeft)]
public virtual System.Drawing.ContentAlignment TextAlign { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

You can use this property to align the text within a label to match the layout of controls on your form. For example, if your controls are located to the right edge of the labels, you can set the Label.TextAlign property to one of the right-aligned horizontal alignments (System.Drawing.ContentAlignment.TopRight, System.Drawing.ContentAlignment.MiddleRight, System.Drawing.ContentAlignment.BottomRight) and the text will be aligned with the right edge of the labels to align with your controls.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0