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

后端 未结 2 1768
悲&欢浪女
悲&欢浪女 2021-02-11 17:36

I\'ve got a WPF TextBox into which my users type XHTML.

XAML...



        
相关标签:
2条回答
  • 2021-02-11 18:07

    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

    0 讨论(0)
  • 2021-02-11 18:11

    You'll want to use a RichTextBox for that.

    0 讨论(0)
提交回复
热议问题