willkara
willkara

Reputation: 177

How do I change the font of the selected text in a rich text box in c#

I am able to change the text of the whole RTB, but not the selected text.

I'm currently trying something around this:

richTextBox1.SelectedText = fontDialog1.Font;

I know that the above method definitely won't work, but it's the current course of action that I'm trying.

But I just don't know how to access the font "field" for the selected text. Any ideas?

Upvotes: 3

Views: 239

Answers (1)

Teoman Soygul
Teoman Soygul

Reputation: 25732

richTextBox1.SelectionFont = new Font("Arial", 16);

Upvotes: 1

Related Questions