WPF 的语法荧光笔
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/454872/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Syntax Highlighter for WPF
提问by Ray Booysen
I'm currently looking for a Syntax highlighter for a WPF application. A textbox will be available for the user to type into which would hopefully recognise code and highlight syntax accordingly.
我目前正在为 WPF 应用程序寻找语法荧光笔。用户可以输入一个文本框,希望能够识别代码并相应地突出显示语法。
I would like to support C# initialy and other languages later.
我想稍后支持 C# initialy 和其他语言。
Duplicate of Question 394751
回答by Remco Eissing
I think this question has your answer.
我想这个问题有你的答案。
Anyone know a code editor I can embed in a WPF window or Windows forms?
任何人都知道我可以嵌入 WPF 窗口或 Windows 窗体的代码编辑器吗?
Or you can write one yourself: http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx
或者你可以自己写一个:http: //blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx
回答by Stefano Driussi
回答by Andrey Shchekin
If you do not mind having no documentation whatsoever, AvalonEditis a good choice. I am currently using for a project, and it is a great tool. I have not encountered a single bug even in complex scenarios.
如果您不介意没有任何文档,AvalonEdit是一个不错的选择。我目前正在用于一个项目,它是一个很棒的工具。即使在复杂的场景中,我也没有遇到过一个错误。
回答by aku
I was looking for the same thing without success. Only solution I found is Actipro's Syntax Highlighterfor WinForms that can be hosted in WPF application. AFAIK Actipro is working on WPF version but I don't know if it ready or not
我一直在寻找同样的东西,但没有成功。我找到的唯一解决方案是 Actipro 的用于 WinForms的Syntax Highlighter,它可以托管在 WPF 应用程序中。AFAIK Actipro 正在开发 WPF 版本,但我不知道它是否准备就绪