Results 1 to 7 of 7

Thread: Simple Progress Bar

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    Kent, UK
    Posts
    41

    Red face

    Can someone please post simple-sample(!) lines of code to make a progress bar work. I.e. fill up to 100% in a few seconds.

    Thanks alot,

    moonfruit

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Code:
    For a = 0 to 100
       ProgressBar1.Value = A
       DoEvents
    Next

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Don't forget to set the
    ProgressBar1.Max = 100
    first
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Its 100 by default

  5. #5
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You can also do this with a timer.

    Private Sub Timer1_Timer()
    ProgressBar1.Value = ProgressBar1.Value + 1 'increases the value by one every time
    If ProgressBar1.Value >= 100 Then ProgressBar1.Value = 0 'sets the value to 0 when it gets to 100 or else it throws errors
    End Sub


    [Edited by MidgetsBro on 10-22-2000 at 06:27 PM]

  6. #6
    Guest
    Like Fox's example, you would usually use a ProgressBar in a Loop rather than a Timer (ie: opening a file)

  7. #7
    Guest
    Use it in a loop rather than a Timer. Works much faster and is less complicated .

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