TX Text Control .NET Server

ForeColor 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

Returns or sets the color used to display the selected text.

Syntax

public Color ForeColor { get; set; }

Examples

The following example formats the heading of a short document by using Selection.ForeColor.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

selection.ForeColor = System.Drawing.Color.LightSteelBlue;
Console.WriteLine($"Fore Color used by Selection: {selection.ForeColor}");

Limitations

Runtime only.

Remarks

The property's default value is the system color for window text.

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.