Is there any way to freeze a window during a complicated update? I have an
application which has to do a fairly complex update to its main window, It
doesn't take long, but it looks kind of sloppy to see parts of the screen
update sequentially. I'd like to freeze the display whhen updating begins,
then release it when the update is done. Can that be done easily? Thanks in
advance.

Signature
David Veeneman
Foresight Systems
Andre Kraemer - 14 Feb 2006 16:39 GMT
Hi David,
did you try this.SuspendLayout(); and this.ResumeLayout()?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemwindowsformscontrolclasssuspendlayouttopic.asp
I guess this should solve your problem.
Cheers
Andre
MCP/MCSD
David Veeneman schrieb:
> Is there any way to freeze a window during a complicated update?
David Veeneman - 14 Feb 2006 18:16 GMT
Thanks. I've never had much luck with SuspendLayout() / ResumeLayout(). But
I'll give it another try.

Signature
David Veeneman
Foresight Systems
Shannon Broskie - 16 Feb 2006 02:13 GMT
I think what you are referring to is Windows not having time to redraw during
your time consuming procedure. Two ways that I know of fixing this; one
being a lot more elegant than the other.
The best way is to perform you lengthy process in a background worker
thread. This keeps your main application thread responsive to redraws and
other items such as status updates from your background worker. When doing
this though you need to make sure that interface elements that should not be
run during the other lengthy process are disabled.
The other pretty bad way to be to sprinkle Application.DoEvents() in your
lengthy process, giving your interface a better chance to redraw.
> Thanks. I've never had much luck with SuspendLayout() / ResumeLayout(). But
> I'll give it another try.