I am writing text editor in c# winforms and I want it to Highlight keywords. Now richtextbox is to slow for opening big files so I am using textbox, but textbox doesn't have a property for setting the color of a selected text. I tr开发者_StackOverflowied to inherit from textbox and override OnPaint method but it doesn't seem to work. I found this code and it looks great but I have no idea how to work with it.
Anyone have a solution?
I'd follow one of the following paths:
- Go purchase a ready-made text editor component with the desired functionality.
- Write a custom control from scratch.
The standard controls you mentioned were not designed for such advanced scenarios which require a much more elaborate processing of the content being edited.
Have you heard of Scintilla? check here or here
精彩评论