turn off screen refresh

hog

Senior Contributor
Joined
Mar 17, 2003
Messages
984
Location
UK
I've been looking through the object explorer without much success to find a method of turning off screen refresh util I've made the required form changes at runtime and then turn it back on so the user sees a smooth change of screen content.

any ideas?
 
Some controls have a BeginUpdate and EndUpdate pair to do this, all controls have a SuspectLayout and ResumeLayout pair just for layout out children.

What exactly did you need it for in this instance?
 
When a user selects to resize the form from a menu as soon as the new width and height values are changed the user sees a momentary glimpse of the controls on the form prior to being rescaled to the new size.

I know in VBA you can turn off screen refresh until you have finished making modifications. Hoping there is something similar in VB.Net
 
Have you tried SuspendLayout and ResumeLayout? If you're modifying the size from the UI thread (which you must be) there shouldn't be a chance for the application to paint itself before the new size takes effect.
 
Divil, this does not work as I still see the momentary blip.

My form if 300*300 with an image on it, I change it to 600*600 and there is a split second where you see the form resizing but with the image still at 300*300, then the image changes to 600*600
 
Back
Top