Your solution works fine for font style. But what about following situation,
I want to change font of richTextBox contents, which is having multiple
look at following example
richTextBox.Text = "This is just a test example"
"This" ---Times New Roman, Bold, 10
Now, I select "This is just" in richTextBox and want to change the font size
to 10 of selected text.
How to accomplish this?
I have written following code. But it doesn't work properly in above
Private sub ChangeFont(FontSize as integer)
Dim fOld As Font = rtbData.SelectionFont
rtbData.SelectionFont = New Font(fOld.FontFamily, FontSize,
In above scenario fOld returns as Nothing so I can't used this.
Thanks and Regards