How to avoid image Flickering in VB.NET?

Also, I believe you need to set the styles in the constructor, not in the Load event.
 
you should move all your drawing-code into the OnPaint override - like aewarnick said - and use e.Graphics there... in the Timer_Tick-Event you then simply do a "Me.Invalidate()" to tell the Form to redraw... should be flicker-free now...

Andreas
 
Store your tick value and Box size Rectangle value in global variables at the top of the Form, below the Form class.
 
That makes sense...only becasue when using SetStyle you have the choice of whether you want it set or not using the bool value.

I am pretty sure then that you can switch DoubleBuffing on and off any time you want.
 
Back
Top