TextBackColor Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets or sets the background color for selected text.
Syntax
public Color TextBackColor { get; set; }Public Property TextBackColor As ColorExamples
The following example formats the heading of a short document by using Selection.TextBackColor.
textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;
selection.TextBackColor = System.Drawing.Color.LightSteelBlue;
Console.WriteLine($"Text Back Color used by Selection: {selection.TextBackColor}");textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As Selection = textControl.Selection
selection.TextBackColor = System.Drawing.Color.LightSteelBlue
Console.WriteLine($"Text Back Color used by Selection: {selection.TextBackColor}")Remarks
The property's default value is the system color for the window background.
The property returns its default value when the text selection contains multiple characters with mixed colors. The Selection.IsCommonValueSelected method can be used to check for mixed attributes.