473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

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
2 1904
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
2
by: bob | last post by:
Hello, I want to show progress to the user while some method is running so I thought I'd use a progress bar. But I don't see how I can do this without writing GUI code in the model? In...
3
by: Bill | last post by:
I am copying data from one FileStream to another in a loop. Inside the loop I display progress messages in a StatusBar. The form has a Stop button that sets a private Boolean variable to true....
8
by: Dino M. Buljubasic | last post by:
I am trying to create a pop up progress bar (on a form) that would show progress from downloading files from an FTP server. any help will be appreciated
14
by: John | last post by:
Hi Is there a way to e-mail using outlook2002 from within vb.net without getting the nasty "An application is trying to access you outlook..." message? Thanks Regards
3
by: Vinay | last post by:
Hello I am trying to update a Progress bar on a form. I am able to update it via using a simple clock timer, but as soon as I perform a long operation G1 (generation of a report) in a separate...
13
by: Just Me | last post by:
Trying threads for the first time. This seems to hang and I wonder if it looks OK to you. Right now the thread t is simply a Form with a Cancel Button. If clicked it should raise an event that...
19
by: felixnielsen | last post by:
Some might remember that i, not so long ago, started a treath or two about a weird 3d labyrinth. I now have a working code, that i want to share, hear comments, advice, ect., but first let me...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.