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

Syntax

public Color ForeColor { get; set; }
Public Property ForeColor() As Color

Examples

The following example uses ForeColor property to set the forecolor of the selected text "TX Text Control" as Yellow.

textControl1.Text = "TX Text Control";

TXTextControl.Selection mySel = new TXTextControl.Selection(3, 4);

mySel.Bold       = true;
mySel.Italic     = true;
mySel.ForeColor  = System.Drawing.Color.Yellow;

textControl1.Selection = mySel;
TextControl1.Text = "TX Text Control"

Dim mySel as TXTextControl.Selection = New TXTextControl.Selection(3, 4)

mySel.Bold       = True
mySel.Italic     = True
mySel.ForeColor  = System.Drawing.Color.Yellow

TextControl1.Selection = mySel

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.