Font Style

rlangi05

Member
Joined
Jan 2, 2006
Messages
21
Programming Experience
1-3
I want to be able to apply more than one font style (eg Italics and Bold, not just Italics). I need to be able to do it to selected text in a rich text box.

VB.NET:
RichTextBox1.SelectionFont = New Font("Arial", 12, FontStyle.Italic)

I use the above code to apply the font style but how can I add do both bold and Italic at the same time... or even Bold, Italic and Underline at the same time?
 
each character can only be displayed in 1 font

you would have to keep changing the SelectionFont at the appropriate times
 
Just Or the styles:
VB.NET:
[COLOR=black][FONT=Courier New]RichTextBox1.SelectionFont =  [COLOR=blue]New[/COLOR] Font([COLOR=maroon]"Arial"[/COLOR], 12,  _
    FontStyle.Italic [COLOR=blue]Or[/COLOR] FontStyle.Bold [COLOR=blue]Or[/COLOR] FontStyle.Underline)
[/FONT][/COLOR]
 
Back
Top