Posts

Showing posts with the label RichTextBox

Donate

Remove Formatting Of Last Selected Text In A WPF RichTextBox Control

Image
Here's how to remove the formatting of last selected text in a WPF RichTextBox control from it's SelectionChanged event. C# Code 1 2 3 4 5 6 private void rtbEditor_SelectionChanged( object sender, RoutedEventArgs e) { //Clear previous selections. TextRange textRange = new TextRange(rtbEditor.Document.ContentStart, rtbEditor.Document.ContentEnd); textRange.ClearAllProperties(); } Output

Donate