Hi, how can I change the font for a currently selected text area inside a WPF RichTextBox?
+1
A:
How about something like:
TextSelection text = richTextBox.Selection;
if (!text.IsEmpty)
{
text.ApplyPropertyValue(RichTextBox.FontSizeProperty, value);
}
KrisTrip
2010-08-16 20:14:42
That is for the font size at least. Theres probably a property for the font family if thats what you wanted to change.
KrisTrip
2010-08-16 20:22:23
Almost there. It works for the font size.But for the font family it changes the entire paragraph and not the selection only.
Néstor Sánchez A.
2010-08-19 20:24:20