TX Text Control .NET Server

TabPositions Property

Property
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 an array containing the absolute tab stop positions, in twips, in a paragraph.

Syntax

public int[] TabPositions { get; set; }

Examples

The following example applies paragraph layout to selected report text by using ParagraphFormat.TabPositions.

textControl.Text = "First item\nSecond item\nThird item";
textControl.Select(0, textControl.Text.Length);
ParagraphFormat paragraphFormat = textControl.Selection.ParagraphFormat;

paragraphFormat.TabPositions = new int[] { 1 };
if (paragraphFormat.TabPositions != null)
{
    Console.WriteLine("Paragraph Format: Tab Positions is available.");
}

textControl.Selection.ParagraphFormat = paragraphFormat;

Limitations

The maximum number of tabs in a line is 14.

Remarks

The default positions are multiple of 1134 twips (2 cm).

The property returns an array with common values when the text selection contains multiple paragraphs with mixed positions. The remaining not common values are set to zero. If all values are different, the Selection.IsCommonValueSelected method returns false.

Further Reading

  • Creating New Styles with TX Text Control .NET for Windows Forms –