Hello,
Your solution works fine for font style. But what about following situation,
I want to change font of richTextBox contents, which is having multiple
styles.
look at following example
richTextBox.Text = "This is just a test example"
"This" ---Times New Roman, Bold, 10
"is"-------arial, Regular,8
"just"-----Courier, Regular,9
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
scenario.
Private sub ChangeFont(FontSize as integer)
Dim fOld As Font = rtbData.SelectionFont
rtbData.SelectionFont = New Font(fOld.FontFamily, FontSize,
fOld.Style)
End Sub
In above scenario fOld returns as Nothing so I can't used this.
Thanks and Regards
Sakharam Phapale
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Sakharam,
To show you the use of the boolean "OR" in this, see this old snippet from
me.
\\\
Me.Label1.Font = New Font(Me.Label1.Font, Me.Label1.Font.Style Or
FontStyle.Bold)
///
I hope this helps?
Cor