BottomDistance Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets a bottom paragraph distance, in twips, at the current input position. If text is selected, the property specifies the bottom distance of the whole selected text.
Syntax
public int? BottomDistance { get; set; }Public Property BottomDistance As Integer?Examples
The following XAML example binds the BottomDistance property to a text box using the WPF.MeasureConverter class. The value of the bottom distance is converted to centimeter.
…
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
…
<Window.Resources>
<tx:MeasureConverter Unit="Centimeter" x:Key="twipsConv" />
</Window.Resources>
…
<TextBox
Text="{Binding
ElementName=textControl1,
Path=InputFormat.BottomDistance,
Converter={StaticResource twipsConv},
Mode=TwoWay}" />The following example changes the formatting applied to text entered at the end of a document by using InputFormat.BottomDistance.
textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;
inputFormat.BottomDistance = 720;
if (inputFormat.BottomDistance != null)
{
Console.WriteLine("Input Format: Bottom Distance is available.");
}textControl.Text = "Project summary"
textControl.InputPosition = New InputPosition(textControl.Text.Length)
Dim inputFormat As InputFormat = textControl.InputFormat
inputFormat.BottomDistance = 720
If inputFormat.BottomDistance IsNot Nothing Then
Console.WriteLine("Input Format: Bottom Distance is available.")
End IfRemarks
The property returns null when the text selection contains multiple paragraphs with different bottom distances.
The WPF.MeasureConverter can be used to convert the property value to another measuring unit.