Remarks
The property returns null when the text selection contains multiple paragraphs with different top distances.
The WPF.
Gets or sets a top paragraph distance, in twips, at the current input position. If text is selected, the property specifies the top distance of the whole selected text.
public int? TopDistance { get; set; }
Public Property TopDistance() As Nullable(Of Integer)
The following XAML example binds the Top
?
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.TopDistance,
Converter={StaticResource twipsConv},
Mode=TwoWay}" />
The property returns null when the text selection contains multiple paragraphs with different top distances.
The WPF.