views:

4418

answers:

8

Where can I find a control for WinForms that will highlight source code pasted into it? I would like one that has syntax highlighting support for many different languages but if it only works with C# I would be fine with that also.

+1  A: 

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.

Vin
+9  A: 

Scintilla.NET is probably what you're looking for

Fernando
This is good and thanks for the link, good to know there is atleast one open-source alternative, but it leaves a lot to desire to get the VS look and feel
Vin
Thanks, this seems to be exactly what I'm looking for.
Botond Balázs
+1  A: 

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.

Mike Hofer
+5  A: 

As Open Source alternatives, give a look to:

CMS
+1  A: 

Thumbs up for Scintilla and its .NET wrapper.

Gia
+2  A: 

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

Dmitri Nesteruk
A: 

you can try this http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx

IMX
+1  A: 

Personally i prefer ICSharpCode.TextEditor, free, easy to use, extendable and good quality control. You can find how to and code sample in this article

Ernest