Recommendation for 3rd party editing/syntax highlighting control - WinForms

徘徊边缘 提交于 2019-11-30 20:28:39

ICSharpCode.TextEditor is free and pretty stable.
As for commercial solution Actipro's SyntaxEditor might be a best choice

Enhancing ICSharpCode.TextEditor was trivial compared with Scintilla.Net. Another huge benefit of ICSharpCode.TextEditor is that allows you to customize/build your own Syntax Highlighting, eg: https://github.com/icsharpcode/SharpDevelop/wiki/Syntax-highlighting.

BUT ICSharpCode.TextEditor is not stable, its riddled with AccessViolations: https://www.google.com.au/search?q=icsharpcode.texteditor+accessviolationexception

You can see these AccessViolations first hand by downloading: http://www.codeproject.com/Articles/30936/Using-ICSharpCode-TextEditor

This build on GitHub behaves better in winforms, but in VSTO it still screams AccessViolations: https://github.com/KindDragon/ICSharpCode.TextEditor

Same as DigitalRune's version of the ICsharp.TextEditor.

I'd recommend the latest WPF implementation: ICSharp.AvalonEdit.

If you need to host this WPF control in Winforms:

public Form1()
{
InitializeComponent();
ICSharpCode.AvalonEdit.TextEditor te = new ICSharpCode.AvalonEdit.TextEditor();
ElementHost host = new ElementHost();
host.Size = new Size(200, 100);
host.Location = new Point(100, 100);
host.Child = te;
this.Controls.Add(host);
}


Some commercial ones I came across (note I'm not affiliated with these companies): http://www.actiprosoftware.com/products/controls/windowsforms/syntaxeditor http://www.qwhale.net/products/editor.htm

Try out ScintillaNET it's a .NET WinForms wrapper around the excellent Scintilla control. Scintilla itself is a free source code editor component that is very customisable and has all the features you asked for. See here for a screenshot.

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