4

i am writing a small app to manage code snippets , so i want a component to display the code (keyword coloring , lines numbering ...) , so where to get this component and if it doesnt exist how to implement it .

edit : i dont want to write a code editor , only a component to display code with last features (keyword coloring , lines numbering ...) instead of plain text area thanks

Radi
  • 6,024
  • 16
  • 57
  • 86
  • I'm guessing you've already considered this, but just in case you haven't... why not use Visual Studio C# code editor? It already has a code snippets feature since VS 2005. http://msdn.microsoft.com/en-us/library/ms165392%28VS.80%29.aspx Why do you need to write your own C# code editor when existing editors already have the features you need? – Mark Byers Aug 07 '10 at 10:56
  • possible duplicate of [Free/open source code editor UI control for .Net](http://stackoverflow.com/questions/2968057/free-open-source-code-editor-ui-control-for-net) – Andrey Aug 07 '10 at 11:13

2 Answers2

4

For syntax highlighting check :

Syntax Highlighting in Rich TextBox Control

Syntax highlighting textbox in C#

How To Implement Syntax Highlighting In A WinForms Application

Also you can check there must be some 3rd party controls.

Incognito
  • 16,037
  • 9
  • 50
  • 72
1

I suggest http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting which has a lot of features.

Also, encapsulating http://ace.c9.io/#nav=about would be an option depending on your technology stack