开发者

Silverlight: Is it possible to syntax-colour XML in a textBox? [duplicate]

开发者 https://www.devze.com 2023-03-06 03:20 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Silverlight开发者_高级运维 XML editor / syntax highlighting
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Silverlight开发者_高级运维 XML editor / syntax highlighting

Hello,

I have some XML in my Silverlight Application that I store in a String and wish to output to the user. The xml is already "pretty printed" in the sense that it is formatted with indentations, but it would make it much clearer to read if I could also add syntax colouring to it.

Can this be done? How do I go about doing it? (please suggest a library or something)

Come to think of it, I'm not even sure if it's at all possible to output coloured text in a .NET interface...

Thank you for any insight!

(PS: I don't care which version of Silverlight)


I looked and did not find a control that would do XML syntax highlighting for a WinForms RichTextBox. This was for an XPath evaluator tool I built. The WinForms RichTextBox has the capability to display colors of course, but I couldn't find one smart enough to highlight XML syntax.

I ended up building one. The approach I used would probably work for WPF as well.

Silverlight: Is it possible to syntax-colour XML in a textBox? [duplicate]

This is the explanation for how I got there:
WinForms RichTextBox : how to reformat asynchronously, without firing TextChanged event

0

精彩评论

暂无评论...
验证码 换一张
取 消