TX Text Control .NET for Windows Forms

LineSpacing Property

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

Description

Specifies the line spacing of a paragraph as a percentage of the font size.

Syntax

public int LineSpacing { get; set; }

Examples

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

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

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

textControl.Selection.ParagraphFormat = paragraphFormat;

Limitations

The property's value must be between 1 and 10000 percent (0.01 to 100 lines).

Remarks

The property's default value is 100 percent.

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.AbsoluteLineSpacing.