TX Text Control .NET Server

Alignment Property

Property|Introduced in 15.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets or sets the frame's horizontal alignment when it is anchored to a paragraph.

Syntax

public HorizontalAlignment Alignment { get; set; }

Members

ValueDescription
LeftThe frame is left aligned.
RightThe frame is right aligned.
CenterThe frame is centered.
JustifyThis value cannot be used with this property.

Examples

The following example adds a callout frame and works with it through the common frame API by using FrameBase.Alignment.

TextFrame callout = new(new System.Drawing.Size(3000, 1200)) { Name = "Callout" };
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText);
FrameBase frameBase = callout;

frameBase.Alignment = TXTextControl.HorizontalAlignment.Center;
Console.WriteLine($"Alignment used by Frame Base: {frameBase.Alignment}");

Remarks

If the image or text frame has another Location than left, right or center, this property returns zero.