TX Text Control .NET Server

TextBackColor Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets or sets the background color for selected text.

Syntax

public Color TextBackColor { get; set; }

Examples

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}");

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.

Further Reading