Good day!
I try to change part of text to red color.
So, i try to use TextBox, but it not works. So, i read, that RichTextBox can do that:i use this question
But i do not know how to append colored text?
TextRange rangeOfText1 = new TextRange(tbScriptCode.Document.ContentEnd, tbScriptCode.Document.ContentEnd);
rangeOfText1.Text = "Text1 ";
rangeOfText1.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue);
rangeOfText1.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);
Ok, i get TextRange, but how to append it to RichTextBox?
Can you tell me how to make some part of text to red color? Thank you!