LineSpacing Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets the line spacing, in percent, at the current input position. If text is selected, the property specifies the line spacing of the whole selected text.
Syntax
public int? LineSpacing { get; set; }Public Property LineSpacing As Integer?Examples
The following XAML example shows how to bind the LineSpacing property to a checkable menu item using the WPF.BooleanConverter class.
…
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
…
<Window.Resources>
<tx:BooleanConverter x:Key="boolConv" />
</Window.Resources>
…
<MenuItem
Header="1.5"
IsCheckable="True"
IsChecked="{Binding
ElementName=textControl1,
Path=InputFormat.LineSpacing,
Converter={StaticResource boolConv},
ConverterParameter=150}" />The following example changes the formatting applied to text entered at the end of a document by using InputFormat.LineSpacing.
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;
inputFormat.LineSpacing = 720;
if (inputFormat.LineSpacing != null)
{
Console.WriteLine("Input Format: Line Spacing is available.");
}textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat
inputFormat.LineSpacing = 720
If inputFormat.LineSpacing IsNot Nothing Then
Console.WriteLine("Input Format: Line Spacing is available.")
End IfRemarks
The property returns null when the text selection contains multiple paragraphs with different line spacing.