469,627 Members | 938 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,627 developers. It's quick & easy.

RichTextBox Highlighting while editting

I am currently trying to control the syntax highlighting of a richtextbox
control whilst the user types. At the moment I have implemented a thread
which calls the richTextBox.Invoke on a method that parses each line of the
richTextBox and highlights specific words with a given color. I have been
highlighting each of the words by using the Select method and changing the
selection color beforehand.

This works fine until the contents of the richtextbox get large enough to
warrant a vertical scrollbar. When this happens the use of select on text
outwith the displayed area causes the richtextbox to jump around screen and
produce flicker. To combat this I DLLImported some User32 methods to control
the scrollbar positions.

Is there a better or simpler way to provide syntax highlighting with user
interaction in c#? I would appreciate any feedback.
Nov 17 '05 #1
0 1497

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Mad Joe | last post: by
2 posts views Thread by paulgabion | last post: by
3 posts views Thread by jman3 | last post: by
3 posts views Thread by MFH | last post: by
reply views Thread by MSDousti | last post: by
1 post views Thread by kelvin.koogan | last post: by
2 posts views Thread by kelvin.koogan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.