System.Windows.Forms.RichTextBox.SelectionColor Property

Gets or sets the text color of the current text selection or insertion point.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public System.Drawing.Color SelectionColor { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

If the current text selection has more than one color specified, this property returns Color.Empty. If no text is currently selected, the text color specified in this property is applied to the current insertion point and to all text that is typed into the control after the insertion point. The text color setting applies until the property is changed to a different color or until the insertion point is moved to a different section within the control.

If text is selected within the control, the selected text and any text entered after the text selection will have the value of this property applied to it. You can use this property to change the color of text in the System.Windows.Forms.RichTextBox.

To make text bold in the control, use the RichTextBox.SelectionFont property to assign a new font that has the bold font style specified.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0