Thread Safe GUI, Example in vb.net 2005

MasterThai
MasterThai used Ask the Experts™
on
I would like an example program that demonstrates the usage of threads to create a program that can update, a statusbarlabel from a different thread.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Software Developer
Commented:
Hi there.

I did the same thing for an app I wrote once, I needed a progress bar to display the status of a task which was running in another thread. To achieve this, I used the .NET 2.0 component called BackgroundWorker. Here are a couple of links to get you going:

http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx
http://www.codeguru.com/columns/vb/article.php/c10755/

Basically the BackgroundWorker is a control that allows you to perform tasks in another thread of execution, whilst your UI carries on responding to user events. Plus the backgroundworker can talk to controls on the form, eg update the value of a progress bar.

Try the links above to get you started, hope this helps.
Jas.

Author

Commented:
I have tried the backgroundworker thread to no avail, I can update most controls, because they allow to be p/invoked I just can't figure out how to update the statusbar

Author

Commented:
Ok well, i figured it out, instead of invoking the control itself i invoked the form and that allowed me to update it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial