45

I'm looking for a free, syntax-highlighting, possibly autocompleting "Programmer's textbox" style control for use in a Visual Studio Windows Forms or WPF project. It should work with C# and self-defined languages, and the licence should permit its use in a closed, in-house development tool.

There are pay-for solutions available - something like http://www.syncfusion.com/products/user-interface-edition/windows-forms/Edit would work fine - but I am looking for something simpler, and would prefer not to pay for unnecessary functionality. Any ideas?

Daniel Situnayake
  • 2,784
  • 2
  • 27
  • 38
  • 17
    Yet another question with a lot of upvotes closed as off-topic. Over zealous moderation completely defeats the purpose of SO. Instead of the rules/guidelines/moderators existing for SO, SO now exists for the rules/guidelines/moderators. ಠ_ಠ – hcoverlambda Nov 04 '16 at 15:47

2 Answers2

29

I've been using the SharpCode.TextEditor for a few cases, and it works quite well - including syntax highlighting and all.

Check out this Using ICSharpCode.TextEditor article on CodeProject for an intro.

alt text

To download it, go to the SharpDevelop web site and download the latest sources. One of the projects included is the Text editor, which you can easily isolate into its own assembly or sub project - you get all the source code, after all!

Community
  • 1
  • 1
marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
  • Just make sure you obey the LGPL. – ParmesanCodice Jun 03 '10 at 17:10
  • Looks good - but what would the impact of this being LGPL licensed be in regards to its use in an in-house-only tool? Judging by my quick wikipedia-ing, this would be fine. – Daniel Situnayake Jun 03 '10 at 17:46
  • http://en.wikipedia.org/wiki/LGPL - it basically allows you to link the code into your apps without further obligations, as long as you don't compete with the original author. E.g. you cannot create a .NET IDE and use their TextEditor as a component, and then sell or market that product – marc_s Jun 03 '10 at 18:46
  • For in-house use, I don't see any issues with the LGPL - but I'm not a lawyer, so don't take my word for it :-) – marc_s Jun 03 '10 at 18:46
  • Looks fantastic - thanks very much. – Daniel Situnayake Jun 03 '10 at 19:07
  • I'm no expert on OS licences either but I think the important points with LGPL are: 1. Give Credit 2. You are allowed to link to the library in commercial software 3. If you change anything in the library those changes must also be released as LGPL. Just something to bear in mind because in-house tools don't always remain in-house. – ParmesanCodice Jun 04 '10 at 07:42
  • It doesn't support RTL langauges –  Feb 18 '14 at 14:46
  • To add to ParmesanCodice's comment: You may *dynamically* link LGPL libraries (DLLs) into your project if you want to avoid having to publish your own source code, but not statically. Applied to C# and managed .Net, do not mix LGPL code with your own code in the same project, unless you are willing to publish your code as well under LGPL. – Christoph Apr 15 '16 at 16:18
24

Scintilla is a powerful, open-source code editing component, and there is a .NET control available for it.

AnthonyVO
  • 3,260
  • 1
  • 28
  • 34
bta
  • 39,855
  • 5
  • 67
  • 92
  • There is also a Demo app that uses the ScintillaNET library on github, https://github.com/hgupta9/ScintillaNET.Demo. Note: The demo app uses the GitHub version of the ScintillaNET control, https://github.com/jacobslusser/ScintillaNET – AnthonyVO Jun 16 '17 at 13:06
  • Scintilla is not pure C# – eri0o May 21 '21 at 12:49