Live Chat Icon For mobile
Live Chat Icon

How do I set the color and font in a RichEditBox

Platform: WinForms| Category: RichTextBox

You use the SelectionFont and SelectionColor properties. Make sure the control had focus. Then the following code will set the currently selected text to a red-bold-courier font. If no text is currently selected, then any new text typed (or inserted) will be red-bold-courier.

	richTextBox1.SelectionColor = Color.Red;
	richTextBox1.SelectionFont = new Font ('Courier', 10, FontStyle.Bold);
	richTextBox1.SelectionColor = Color.Red
	richTextBox1.SelectionFont = new Font ('Courier', 10, FontStyle.Bold)

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.