I\'m using the RichTextBox.AppendText
function to add a string to my RichTextBox
. I\'d like to set this with a particular colour. How can I do this?
the above single line answer:-
myRichTextBox.AppendText("items", "CornflowerBlue")
is not working.The correct way it should be writen is (i am using VS 2017) :-
Dim text1 As New TextRange(myRichTextBox.Document.ContentStart, myRichTextBox.Document.ContentEnd)
myRichTextBox.AppendText("items")
text1.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.CornflowerBlue)