开发者

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

开发者 https://www.devze.com 2023-03-06 10:23 出处:网络
I am able to change the text of the whole RTB, but not the selected text. I\'m currently trying something around this:

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开发者_StackOverflow中文版 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?


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

精彩评论

暂无评论...
验证码 换一张
取 消