1
Answer

RichTextBox.SelectionFont property

hear2058

hear2058

20y
2.4k
1
I am basically writting a wordpad control using a richTextBox Control in C#. I am taking the richTextBox control and simply adding a tool bar to it so that i can change the font, alignment of text, add bullets, etc... I am finished and have it working the way I want except one thing. When I hightlight text that has more than one font, the selectionFont property returns null. For Example: I want to highlight a bunch of text with different fonts and just change the size property(the way it works in wordpad). To do this I have to create a new font object and set it equal to the selectionFont property of the richTextBox control. But doing this removes all the previous formatting. I hope this makes sense what I am trying to do. Does anyone know of a way that I can do this. Any help will be greatly appreciated. Thanks, Kheard
Answers (1)