Solved

Thread Safe GUI, Example in vb.net 2005

Posted on 2007-04-05
3
273 Views
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.
0
Comment
Question by:MasterThai
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
MrClyfar earned 125 total points
Comment Utility
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.
0
 
LVL 2

Author Comment

by:MasterThai
Comment Utility
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
0
 
LVL 2

Author Comment

by:MasterThai
Comment Utility
Ok well, i figured it out, instead of invoking the control itself i invoked the form and that allowed me to update it.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
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:…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now