Remarks
The property returns null when the text selection contains multiple characters with mixed colors.
Returns or sets the color used to display the text at the current input position. If text is selected, the property specifies the text color of the whole selected text.
public System.Drawing.Color? TextColor { get; set; }
Public Property TextColor() As Nullable(Of System.Drawing.Color)
The following XAML example shows how to bind the Text
?
xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
?
<Window.Resources>
<tx:ColorConverter x:Key="colorConv" />
</Window.Resources>
?
<Rectangle
Width="20"
Height="20">
<Rectangle.Fill>
<SolidColorBrush
Color="{Binding
ElementName=textControl1,
Path=InputFormat.TextColor,
Converter={StaticResource colorConv}}" />
</Rectangle.Fill>
</Rectangle>
The property returns null when the text selection contains multiple characters with mixed colors.