Results 1 to 3 of 3

Thread: HELP!!! Progress Bar value settings

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    Midwest
    Posts
    35

    Exclamation

    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!!!


  2. #2
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    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

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Location
    Midwest
    Posts
    35

    Exclamation Thanks!

    Thanks for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width