472,982 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 software developers and data experts.

Simple multithreading

I have some code that iterates through a directry doing stuff and I would
like to get the results text box I have on the windows form, to update
accordingly. I have a progress bar that was working fine but when I put the
textbox on the form the whole form blanks until the processing is complete.

How would I go about using threads to keep the form components updating
themselves?

Thanks for any help,
Grant
Jul 21 '05 #1
4 1055
Here's a primer on multi-threading by Chris Sells
http://msdn.microsoft.com/library/de...ms06112002.asp

Juval Lowy has a good component for running background tasks called
BackGroundWorker:
http://www.idesign.net/idesign/Deskt...ndex=5&tabid=8

HTH,
Jorge

"Grant" wrote:
I have some code that iterates through a directry doing stuff and I would
like to get the results text box I have on the windows form, to update
accordingly. I have a progress bar that was working fine but when I put the
textbox on the form the whole form blanks until the processing is complete.

How would I go about using threads to keep the form components updating
themselves?

Thanks for any help,
Grant

Jul 21 '05 #2
You are thinking about using
a = new System.Threading.Thread( addressof somesub )
a.start

?
Jul 21 '05 #3
Thanks Jorge,
Some useful info on that msdn link...

"Jorge Matos" <Jo********@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
Here's a primer on multi-threading by Chris Sells:
http://msdn.microsoft.com/library/de...ms06112002.asp

Juval Lowy has a good component for running background tasks called
BackGroundWorker:
http://www.idesign.net/idesign/Deskt...ndex=5&tabid=8

HTH,
Jorge

"Grant" wrote:
I have some code that iterates through a directry doing stuff and I would
like to get the results text box I have on the windows form, to update
accordingly. I have a progress bar that was working fine but when I put
the
textbox on the form the whole form blanks until the processing is
complete.

How would I go about using threads to keep the form components updating
themselves?

Thanks for any help,
Grant

Jul 21 '05 #4
Yeah something real simple like that. I need to be able to have two threads,
thread A updates the windows form components, textbox and progress bar, and
Thread B does all the work (Occasionally telling Thread A where its at).

"Doker" <do****@wp.pl> wrote in message
news:d1**********@node2.news.atman.pl...
You are thinking about using
a = new System.Threading.Thread( addressof somesub )
a.start

?

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeff Yang | last post by:
These days,I have read the artile "Safe, Simple Multithreading in Windows Forms, Part 1" on MSDN,and I also runed the example of it....
16
by: Robert Zurer | last post by:
Can anyone suggest the best book or part of a book on this subject. I'm looking for an in-depth treatment with examples in C# TIA Robert Zurer robert@zurer.com
5
by: sarge | last post by:
I would like to know how to perform simple multithreading. I had created a simple form to test out if I was multithreading properly, but got buggy results. Sometime the whole thig would lock up...
2
by: sergejusz | last post by:
Hi all, Please take a look at simple set of VB.NET classes to develop "boss-workers"- style multithreading applications. Maybe it will help somebody: http://www.sergejusz.com/boss_workers.htm ...
7
by: Ray | last post by:
Hello, Greetings! I'm looking for a solid C++ multithreading book. Can you recommend one? I don't think I've seen a multithreading C++ book that everybody thinks is good (like Effective C++ or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.