views:

603

answers:

1
  • Language = C#
  • .NET version = 3.5

When my code performs syntax highlighting the text appears, to the user, to be scrolling automatically. This becomes a severe problem when there is several hundred lines of text in the rich text box. So, how can I programmatically modify the text's color without causing the user to see anything other than the color change?

Thanks for any and all assistance.

+1  A: 

Have you tried something like this:

Save selstart position. 
Disable updates to the text box.  
Apply syntax highlighting.
Set selstart to saved value.  
Enable updates.
Argalatyr
I did everything except disable updates and enable updates. Now that I did that it works fine. Thank you.
Mackenzie
I recognized the problem, even though I don't speak C#, having been there myself.
Argalatyr