Reputation: 1866
I'm using a WPF RichTextBox control to input some text with user formatting capability, including font size adjustment. The built-in commands for IncreaseFontSize and DecreaseFontSize will adjust the font size by 0.75pt each time the command is executed. I would like to increase the granularity to 2pt.
Can this be done without implementing my own custom commands?
Upvotes: 1
Views: 1532
Reputation: 2121
Unfortunately the value is hard-coded and you cannot change it. The fastest way to implement this is to use the TextRange class. Something like this:
var range = new TextRange( rtb.Document.ContentStart, rtb.Document.ContentEnd );
range.ApplyPropertyValue( TextElement.FontSizeProperty, 30.0 );
Upvotes: 1