Dennis
Dennis

Reputation: 9

How do I change the font in a WPF RichTextBox

I am trying to change the font in a WPF RichTextBox using .Net Framework 4.5.2 and Visual Basic.

All of the examples such as SelectionFont give the error "SelectionFont is not a member of RichTextBox". Any advice on where to look would be helpful.

Upvotes: 0

Views: 812

Answers (1)

Giangregorio
Giangregorio

Reputation: 1510

You can try with:

YourRichTextBox.Selection.ApplyPropertyValue(TextElement.FontFamilyProperty, new FontFamily("Comic Sans MS"))

Upvotes: 1

Related Questions