flicker in control

  • Thread starter Thread starter dragonslayer008
  • Start date Start date
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?
 
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
 
Back
Top