By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 820 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

how to code a user defined loop to run a progress bar as a separate thread

P: n/a
I am trying to code a program that inputs a number (the max value) for a
progress bar which will execute as a separate thread. I know how to create a
progress bar as a separate thread but I am having difficulty trying to
create the user defined loop for the progress bar. Any help is appreciated!
Thanks
Jonathan


Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
So you want the user to enter the max value of the progress bar, and then let
the progress bar run from 0 to the max value? What type of operation will it
be, or is it just for testing.

Create a simple for / next loop for testing. Define the operation as a Sub,
and execute the sub by using a thread.

Sub RunProgress()

dim myCounter as long
progressBar.Max = clng(txtMaxValue.text)

for myCounter = 0 to clng(txtMaxValue.text)
progressBar.value = myCounter
next

End Sub

Call it like this

.....
dim th as new thread(AddressOff RunProcess)
th.start
....


"Viet" wrote:
I am trying to code a program that inputs a number (the max value) for a
progress bar which will execute as a separate thread. I know how to create a
progress bar as a separate thread but I am having difficulty trying to
create the user defined loop for the progress bar. Any help is appreciated!
Thanks
Jonathan


Nov 21 '05 #2

P: n/a
"Viet" <vp**@starcalif.com> schrieb:
I am trying to code a program that inputs a number (the max value) for a
progress bar which will execute as a separate thread. I know how to create
a
progress bar as a separate thread but I am having difficulty trying to
create the user defined loop for the progress bar.


Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>

(Although the sample is written in C#, take a look at the last link on the
page referenced above.)

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.