Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am using a timer to move a panel from on point to another. But moving the screen flickers a lot. How do i stop flickering of screen. Somebody please help.
Posted
Comments
Sergey Alexandrovich Kryukov 22-Sep-11 13:38pm    
What is flickering: something a parent Form or on a moving panel?
--SA

1 solution

I did not see what exactly flickering. Try to set double buffering on parent form (or a parent control of moving panel) or panel itself, or both and see what happens. Use the property System.Windows.Forms.Control.DoubleBuffered. For a control (Panel) it also requires calling protected SetStyle, so do it in your derived class. You will need to add styles System.Windows.Forms.ControlStyles.OptimizedDoubleBuffer | System.Windows.Forms.ControlStyles.AllPaintingInWmPaint.

See:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.setstyle.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.doublebuffered.aspx[^].

—SA
 
Share this answer
 
Comments
Ehtesam Ahmed 22-Sep-11 16:37pm    
thanks but how do i add this to my code??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900