A textbox/richtextbox that has syntax highlighting? [C#] [closed]

Solution 1:

Scintilla.NET is probably what you're looking for

Solution 2:

Just recently have found a nice control from codeproject Fast Colored TextBox for syntax highlighting.

The only issue with using Rich Text Box as highlighter is slow performance on coloring, in cases when the size of the document is big. For a medium size documents this issue can be fixed by delayed highlighting.

Solution 3:

As Open Source alternatives, give a look to:

  • dotNetFireball
  • ICSharpCode.TextEditor from SharpDevelop

Solution 4:

Add ICSharpCode.TextEditor assembly reference to a project, choose assembly and controls for Visual Studio Toolbox. After that, you can put control to the Form. Surprisingly, you will not see Property to choose syntax highlight schema. Instead of this, you have to use method SetHighlighting. String parameter sets highlighting schema from available schemas list. These schemas are embedded into the control.

How to use, change schemas and download sample, look following article