Can anyone tell me how I make sure controls are repainted during a loop I'm trying to slide a groupBox outside the window like this (and back in again later on):
while ( groupBox1.Left < 800 )
groupBox1.Left++;
I need to make sure all contained are repainted in each loop, to make the animation look smooth.
OR - is there a better way to do this
Thanks for your help, Mikael

How do I force controls to repaint during a loop
Apolo H
Olusola Abiodun
Application.DoEvents() is what you need to force a paint.
OmarShahine
themcfet
Thanks a lot for your replies - the code
while ( groupBox1.Left < this.Width + 50 ){
groupBox1.Left += 10;
Application.DoEvents();
} works like a charm. I'm now adding 10 pixels in each loop, and it works the way I want it to ...
Thanks, Mikael