TXTextControl.InputFormat.TextBackColor Property

Gets or sets the color used to display the text background color at the current input position. If text is selected, the property specifies the background color of the whole selected text.

Syntax

[C#]
public System.Drawing.Color? TextBackColor { get; set; }
[Visual Basic]
Public Property TextBackColor() As Nullable(Of System.Drawing.Color)

Remarks

The property returns null when the text selection contains multiple characters with mixed colors.

Example

The following XAML example shows how to bind the TextBackColor property to the fill color of a rectangle using the WPF.ColorConverter class.

…
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.TextBackColor,
                Converter={StaticResource colorConv}}" />
    </Rectangle.Fill>
</Rectangle>

See Also