Gets or sets the horizontal text alignment.

Syntax

public HorizontalAlignment Alignment { get; set; }
Public Property Alignment() As HorizontalAlignment

Members

Member Description
Left Text is left aligned.
Right Text is right aligned.
Center Text is centered.
Justify Text is justified.

Examples

The following example uses the Alignment property to set the horizontal text alignment to value: Center.

TXTextControl.ParagraphFormat format = new TXTextControl.ParagraphFormat();

format.Alignment  = TXTextControl.HorizontalAlignment.Center;
format.Frame      = TXTextControl.Frame.Box;
format.FrameStyle = TXTextControl.FrameStyle.Double;

textControl1.Selection.ParagraphFormat = format;
Dim format As TXTextControl.ParagraphFormat = New TXTextControl.ParagraphFormat()

format.Alignment  = TXTextControl.HorizontalAlignment.Center
format.Frame      = TXTextControl.Frame.Box
format.FrameStyle = TXTextControl.FrameStyle.Double

TextControl1.Selection.ParagraphFormat = format

Remarks

The property's default value is HorizontalAlignment.Left.

The property returns its default value when the text selection contains multiple paragraphs with mixed alignment. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.