|
-
Nov 7th, 2000, 01:37 PM
#1
Thread Starter
Member
What is the best way to set the max for a progess bar and also the value for it. I need to show the progress for searching directories and finding matched files according to the searching criteria. Sample code:
For counter = 1 To lngDriveLen Step 4
List1.AddItem (Mid(txtDriveName, counter, 3))
ProgressBar1.Value = counter
Next counter
HELP!!!
-
Nov 7th, 2000, 02:09 PM
#2
Fanatic Member
For the little sample you provided, set the Max property of the ProgressBar to lngDriveLen (or in general cases, the Max property will represent the total amount of stuff that needs to be done). You have the right idea with putting counter into the Value property, but you may want to stick an On Error Resume Next statement just before setting the value. I've noticed some times where setting the value of a progress bar can make an error even if the value is legal based on the Min and Max properties.
Code:
ProgressBar1.Min = 1
ProgressBar1.Max = lngDriveLen
For counter = 1 To lngDriveLen Step 4
List1.AddItem (Mid(txtDriveName, counter, 3))
On Error Resume Next
ProgressBar1.Value = counter
Next counter
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
-
Nov 7th, 2000, 07:00 PM
#3
Thread Starter
Member
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|