prevent windows form from "hang"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Iam developing an application using windows forms as the gui. The
application is doing some heavy database work. While this work is done (I use
separate threads for this) I would like to print some information in the gui
but I dont know how to do, because it seems like the gui is locked? What can
I do to make this work?

Thanks
Julia
 
In addition to Stoitcho's suggestion you can use the same method to invoke a
method in your gui thread that just calls Application.DoEvents().

You could even run this call from a System.Timers.Timer that is running
while your other worker-thread is getting the database info. Invoke would
still be necessary though in either case.


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top