Alignment Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets or sets the frame's horizontal alignment when it is anchored to a paragraph.
Syntax
public HorizontalAlignment Alignment { get; set; }Public Property Alignment As HorizontalAlignmentMembers
| Value | Description |
|---|---|
| Left | The frame is left aligned. |
| Right | The frame is right aligned. |
| Center | The frame is centered. |
| Justify | This 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}");Dim callout As New TextFrame(New System.Drawing.Size(3000, 1200)) With { .Name = "Callout" }
textControl.TextFrames.Add(callout, TextFrameInsertionMode.DisplaceText)
Dim frameBase As 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.