LineSpacing Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Specifies the line spacing of a paragraph as a percentage of the font size.
Syntax
public int LineSpacing { get; set; }Public Property LineSpacing As IntegerExamples
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;textControl.Text = "First item" & vbCrLf & "Second item" & vbCrLf & "Third item"
textControl.Select(0, textControl.Text.Length)
Dim paragraphFormat As ParagraphFormat = textControl.Selection.ParagraphFormat
paragraphFormat.LineSpacing = 720
Console.WriteLine($"Line Spacing used by Paragraph Format: {paragraphFormat.LineSpacing}")
textControl.Selection.ParagraphFormat = paragraphFormatLimitations
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.