Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress bar1 . How Do I 1

Status
Not open for further replies.

lexx

Technical User
Nov 23, 2000
25
US
Hi !. I am new to VB6 programing. So far I have dicovered how to place a progress bar1 on a form. now I am triing to get the bar to advance using the counter during the calculation process using code.

Iam using a do while loop for the calc

do
counter = counter + 1
The counter may increment from 1 to 555.
progressbar1.min = 0
progressbar1.max = 100.

this will be in a do while loop.

The bar is in a label called lbltime, visible properties are false till the cmd calc
click event, than the prb1 turns visible.

lbltime.caption = ' will show the prb1

the prb1 lbltime is horizontaly sized, with 15 increments

The "Q" is how do I get the code to act on the counter count up, so the progress bar will advance with the counter.

Thanks Heaps.........<> Yet
 
You don't need the label. Just add a progress bar to the form. If you do not want the progress bar to be seen, set the Visible property to False. When you want it to be seen, set the Visible property to True.

Before you go into the loop, se the Min and Max properties.

Inside your loop, set the Value property of the progress bar.

Sample:
Dim lMax As Long
Dim lValue As Long
lMax = 10000 ' work out the max to get the bar to go from 0% to 100%
ProgressBar1.Min = 0
ProgressBar1.Max = lMax
Do Until lValue >= lMax ' prevents getting erros trying to set a value > maximum
' do some processing
lValue = lValue + 1
ProgressBar1.Value = lValue
Loop

Simon
 
that did it.. X-) I guess looking at so much code Blinded me for a time....Thanks to S. Williams

::)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top