Thread Safe GUI, Example in vb.net 2005

Posted on 2007-04-05
Medium Priority
Last Modified: 2008-02-01
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.
Question by:MasterThai
  • 2
LVL 10

Accepted Solution

Jason Evans earned 500 total points
ID: 18862907
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:


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.

Author Comment

ID: 18864426
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 Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
SingleRun is a tool that ensures that only one instance of an application is started, running it again brings the application to focus.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question