A textbox/richtextbox that has syntax highlighting? [C#] [closed]

不问归期 提交于 2019-11-26 21:45:16

Scintilla.NET is probably what you're looking for

Just recently have found a nice control from codeproject Fast Colored TextBox for syntax highlighting.

The only issue with using Rich Text Box as highlighter is slow performance on coloring, in cases when the size of the document is big. For a medium size documents this issue can be fixed by delayed highlighting.

As Open Source alternatives, give a look to:

David Maron

Add ICSharpCode.TextEditor assembly reference to a project, choose assembly and controls for Visual Studio Toolbox. After that, you can put control to the Form. Surprisingly, you will not see Property to choose syntax highlight schema. Instead of this, you have to use method SetHighlighting. String parameter sets highlighting schema from available schemas list. These schemas are embedded into the control.

How to use, change schemas and download sample, look following article

If you're willing to pay for a control, I highly recommend this one: QWhale Syntax Edit. It's got a ton of features, comes with source code, and supports a lot of languages. I use it myself for C#, VB.NET, SQL (MS & Oracle), and it's got everything that VS provides.

Check out the AvalonEdit control. There is a good article on CodeProject explaining how to use it.

Not sure if there is any out of the box non-thirdparty solution to this.

But, have you looked at Actipro SyntaxEditor component. LinqPad, the ubercool linq tool uses it for syntax highlighting and intellisense.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!