Results 1 to 3 of 3

Thread: Working Progress Bar [Resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    107

    Resolved Working Progress Bar [Resolved]

    I'm trying to learn how to make my progress bar work but im really tired. I've given it a go though but need some help.

    i have some text that starts at 0 and goes to 500. I would like to know how to make my progress bar show how much has been done whilst it's counting up to 500.

    Thanks in advance
    Last edited by BefunMunkToloGen; Mar 10th, 2005 at 04:56 AM.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Working Progress Bar

    The progressbar have a Min and a Max property. In your case you should set Min to 0 and Max to 500. Then all you have to do is change its Value property to your counter value and the progressbar will do the rest.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Working Progress Bar

    Here is some working code.

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     Dim x As Integer
    4.     Dim dblClock As Double
    5.    
    6.    
    7.     For x = 1 To 500
    8.         ' This code just delays the loop a bit so we can see
    9.         ' the progressbar moving
    10.         dblClock = Timer
    11.         While Timer < dblClock + 0.01
    12.             DoEvents
    13.         Wend
    14.    
    15.         ProgressBar1.Value = (x / 500) * 100
    16.    Next
    17. End Sub
    18.  
    19. Private Sub Form_Load()
    20.  
    21.     ProgressBar1.Min = 0
    22.     ProgressBar1.Max = 100
    23.    
    24.  
    25. End Sub

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