Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Freeze window during update?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Veeneman - 14 Feb 2006 15:49 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.