views:

853

answers:

2

Hello, I'm looking for a RichTextBox with syntax highlighting! Sounds easy but I'm searching since months and didn't find that what I need.

First I started to do it by myself... No good idea...

I tried to use this: http://blogs.microsoft.co.il/blogs/tamir/archive/2006/12/14/RichTextBox-syntax-highlighting.aspx

but that code don't handle loading files or pasting so i started to write a highlight function for inserting text-blocks. That tutorial and my code worked fine first, but then I saw a lot of tiny bugs and loading large files took too much time.

Then a found a lot of similar tutorials/codes at codeproject.com like this: http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx

But there I get problems if the file becomes large, too. Pasting and loading files will take a while...

I think I'm searching for something like this: http://www.aqistar.com/

But I don't can spent money and I want to sell my program maybe so the code/control should be free.

Can anybody help me?

+11  A: 

AvalonEdit is the WPF-based text editor used in SharpDevelop 4.0. It has built-in support for syntax highlighting for several languages and you can add new highlighting definitions using an XML-based file format.

AvalonEdit is open-source, but can also be used in commercial applications (LGPL).

If you don't want to use WPF, you could also use ICSharpCode.TextEditor, the old Windows Forms text editor from SharpDevelop 3.x.

Daniel
+4  A: 

Give a look to these open source projects:

CMS