Solved

Thread Safe GUI, Example in vb.net 2005

Posted on 2007-04-05
3
282 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
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:

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
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
0
 
LVL 2

Author Comment

by:MasterThai
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display

735 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