Progress Bar

G

Guest

I need some help understanding the coding of a progress bar.
I am running a form which has the progress bar and then at some stage this
form calls a form which runs in the back ground but which should also update
the progress bar.
The progress bar should measure the processes on form one and two as it
finish. There are a total of 18 processes.
The progress bar consists of two rectangles, the boxProgressBar and the
rectProgressBar which is on top and smaller than the boxProgressBar.
This is the code I got of the internet which is a variation on Microsoft
Q304581.
The code is between the start code and end code blocks:

start code:
Dim intCurrentProgress As Integer
Dim intTotalWidth As Integer
Const intProgressBarMax As Integer = 18
intTotalWidth = Me.boxProgressBar.Width
End code

Now as I understand it the next part should go after each process which will
update the progress bar.

start code:
For intCurrentProgress = 1 To intProgressBarMax
Me.rectProgressBar.Width = (intTotalWidth / intProgressBarMax) *
intCurrentProgress
Me.Repaint
Next intCurrentProgress
End Code.

I need to know what is wrong with this, because my progress bar is not
updating or do I have it all wrong. Secondly, how do I change the code to
update the progress bar from the second form running? Does the 1 in "1 To
intProgressBarMax" change with every process or stay the same?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top