471,318 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 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 1019
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Robert Zurer | last post: by
5 posts views Thread by sarge | last post: by
7 posts views Thread by Ray | last post: by
reply views Thread by rosydwin | last post: by

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.