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

扶醉桌前 提交于 2019-12-19 03:12:16

问题


I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are:

  1. Stability
  2. Value (price)
  3. Ability to easily customize syntax to highlight
  4. Light weight

回答1:


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




回答2:


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


回答3:


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.



来源:https://stackoverflow.com/questions/41796/recommendation-for-3rd-party-editing-syntax-highlighting-control-winforms

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