Change font in RichTextBox

Ming_Lei

Freshman
Joined
May 6, 2004
Messages
41
Location
Seattle, WA
I have a RichTextBox and FontDialog in the form. I like a selected portion of the text in the RichTextBox to change to the font I have selected in the FontDialog - how do I do it?

- Thanks.
 
You might try this:
Visual Basic:
FontDialog1.Font = RichTextBox1.SelectionFont
FontDialog1.Color = RichTextBox1.SelectionColor
If FontDialog1.ShowDialog = DialogResult.OK Then
       RichTextBox1.SelectionFont = FontDialog1.Font
End If
 
Back
Top