Quantcast
Viewing all articles
Browse latest Browse all 256

WPF VB Formatting only last selection in Richtextbox using TextRange or TextSelection

0
down vote
favorite


I'm working in wpf and visual basic. When I select text in RichTextBox i use TextRange:
Code:

dim selection1 as New TextRange(Richtextbox.selection.start,Richtextbox.selection.end)
Later:
Code:

selection1.ApplyPropertyValue(ForegroundProperty, brushes.Red)
When I am marking text many times the color changes also in the previous selections. I want change color only last selection. How to do this?

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>