Syntax Highlight for Editor

L

LearnMore.John

Hello Gurus

At present i am developing an editor using C#.....

How can i achieve Syntax highlighting, comment highlighting
and other stuffs without flickering...



thanks in advance
 
N

Nicholas Paldino [.NET/C# MVP]

Well, that's a tall order. In order to do anything without flickering
though, you need to double buffer the drawing. In other words, you create a
compatable device context, draw on that, and then copy it over to the
current device context.

You used to do it with a call to BitBlt. However, with controls, you
can just call the SetStyle method on your control and set the
OptimizedDoubleBuffer flag to true. Then, you make sure that all of your
painting is done in your overridden OnPaint method.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top