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.
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.
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.
As Open Source alternatives, give a look to:
- dotNetFireball
- ICSharpCode.TextEditor from SharpDevelop
Check out the AvalonEdit control. There is a good article on CodeProject explaining how to use it.
you can try this http://www.codeproject.com/KB/edit/SyntaxHighlighting.aspx
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