flicker in control

D

dragonslayer008

I have made a custom control which displays a 3D object. The user can
use the mouse to animate the object. However, I am getting bad
flicker from the control. I call Invalidate in the mouse move handler
to animate the object.
I think the problem is the control repaints itself and then I draw
over that myself, so it gets painted twice causing the flicker. In
Win32 I would use a null brush or handle the WM_ERASEBKGND message to
prevent this. Is there a flag I can set in the control to let it know
I will do all the drawing?
 
G

G Himangi

Following code enables double-buffering on a control :

ctrl.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);
ctrl.UpdateStyles();

---------
- G Himangi, Sky Software http://www.ssware.com
Shell MegaPack : GUI Controls For Drop-In Windows Explorer like Shell
Browsing Functionality For Your App (.Net & ActiveX Editions).
EZNamespaceExtensions.Net : Develop namespace extensions rapidly in .Net
EZShellExtensions.Net : Develop all shell extensions,explorer bars and BHOs
rapidly in .Net
 

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