开发者

Writing text editor with keywords Highlighting

开发者 https://www.devze.com 2023-04-04 12:22 出处:网络
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 th

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:

  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.


Have you heard of Scintilla? check here or here

0

精彩评论

暂无评论...
验证码 换一张
取 消