2

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 tried 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?

geniaz1
  • 1,143
  • 1
  • 11
  • 16

2 Answers2

3

I'd follow one of the following paths:

  1. Go purchase a ready-made text editor component with the desired functionality.
  2. 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.

Ondrej Tucny
  • 27,626
  • 6
  • 70
  • 90
0

Have you heard of Scintilla? check here or here

Community
  • 1
  • 1
Smith
  • 5,765
  • 17
  • 102
  • 161