TX Text Control .NET for Windows Forms

AbsoluteLineSpacing Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Gets or sets the line spacing of a paragraph in twips.

Syntax

public int AbsoluteLineSpacing { get; set; }

Examples

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

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

paragraphFormat.AbsoluteLineSpacing = 720;
Console.WriteLine($"Absolute Line Spacing used by Paragraph Format: {paragraphFormat.AbsoluteLineSpacing}");

textControl.Selection.ParagraphFormat = paragraphFormat;

Limitations

Runtime only.

The property's value must be between 20 twips (1 pt) and 32000 twips (1600 pt).

Remarks

The property's default value is 0, indicating that the line spacing depends on the font height.

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

See Also

ParagraphFormat.LineSpacing.