System.Windows.Forms.RichTextBox.SelectionFont Property

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

Syntax

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

Value

Documentation for this section has not yet been entered.

Remarks

If the current text selection has more than one font specified, this property is null. If no text is currently selected, the font 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 font setting applies until the property is changed to a different font 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 font style of text in the System.Windows.Forms.RichTextBox. You can make the text in the control bold, italic, and underlined. You can also change the size of the text and the font applied to the text.

To change the color of the text in the control, use the RichTextBox.SelectionColor property.

Requirements

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