Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh/redraw winForm 1

Status
Not open for further replies.

cjburkha

Programmer
Jul 30, 2004
76
US
Hi, I have a simpl form, with one button on it. When you click the button, some things happen that take maybe 3 minutes. How can I return control to the form during this time?

That is, during this time, the form can't be moved, and I update a lable with a counter indicating progress, but if you click a different window and come back, the form is not redrawn.

Any ideas?

Thanks

CJB
 
Put your long-running process in it's own thread.

Be sure not to update the form from that other thread -- you can only touch a WinForm from the thread that created it.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks Chip. I've never done multi-threads before, but I can figure it out with some help from Google.

Any suggestions on how to update the form then? I could have some timer that checks to see if the thread is still running, but I would like to display the iterations that the thread has completed.

thanks,

CJB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top