Flicker-Free Control Refreshing (VB.NET)
-
I don't even know if anyone will have any idea how to do this. I am having trouble when i invalidate a control, it will update but will flicker in the process. Is there any way to do something like suspend the control from updating on the screen until after it has fully refreshed? I know there must be some way to do what i am wanting.
if (your.Life != lifestyles.Programming) { me.Hate(your.Life) = true; } Do not click this link
-
I don't even know if anyone will have any idea how to do this. I am having trouble when i invalidate a control, it will update but will flicker in the process. Is there any way to do something like suspend the control from updating on the screen until after it has fully refreshed? I know there must be some way to do what i am wanting.
if (your.Life != lifestyles.Programming) { me.Hate(your.Life) = true; } Do not click this link
-
I think you still get the flicker when you resume. Be sure this is not when you close a dialog, 1.0 and 1.1 (and it may still be there) had a dramatic flicker if you use the DialogResult to manage the closing of a dialog, always explicitly close a dialog.
Never underestimate the power of human stupidity RAH
-
I don't even know if anyone will have any idea how to do this. I am having trouble when i invalidate a control, it will update but will flicker in the process. Is there any way to do something like suspend the control from updating on the screen until after it has fully refreshed? I know there must be some way to do what i am wanting.
if (your.Life != lifestyles.Programming) { me.Hate(your.Life) = true; } Do not click this link
A few suggestions:
- Only do paint routines in the proper painting events (OnPaint). Do not alter the painting in mouse events or any other events.
- Use the SetStyle of custom controls to allow for DoubleBuffering/more precise painting control/paint event mapping. DoubleBuffering is a key in reducing flickering.
- This sort of ties with my first point, but be sure that your logic is separate from your actual painting. One of my articles Basics of Falling Blocks in VB 2005[^] has helped many people reduce flickering in their programs because of the painting concepts discussed.
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios Discounted or Free Software for Students: DreamSpark - downloads.channel8.msdn.com MSDN Academic Alliance - www.msdnaa.com