Can I color different parts of text in a WPF TextBox? Can I color different parts of text in a WPF TextBox? wpf wpf

Can I color different parts of text in a WPF TextBox?


Like Kent said with a TextBox you're stuck with one color.

Here is a small article on simple RTB syntax highlighting that should give you most of what you need.

http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx


You will have to create a custom control inheriting the TextBox control and follow this example:

Drawing Formatted Text