How do i make a fully working progress bar?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blurbint
    New Member
    • Nov 2006
    • 37

    #1

    How do i make a fully working progress bar?

    um, mine progress bar isnt working, it come up with an error like this



    this is the code
    Code:
    Private Sub Timer1_Timer()
    Timer2.Enabled = True
    If ProgressBar1.Value = "90" Then
    Timer1.Enabled = False
    Label1.Caption = "Rofl Pantofl"
    End If
    End Sub
     
    Private Sub Timer2_Timer()
    ProgressBar1.Value = ProgressBar1.Value + 10
    If ProgressBar1.Value = "200" Then
    Label1.Caption = "uber roflpantofl"
    End If
    End Sub
    I use vb6.
  • albertw
    Contributor
    • Oct 2006
    • 267

    #2
    Originally posted by Blurbint
    um, mine progress bar isnt working, it come up with an error like this



    this is the code
    Code:
    Private Sub Timer1_Timer()
    Timer2.Enabled = True
    If ProgressBar1.Value = "90" Then
    Timer1.Enabled = False
    Label1.Caption = "Rofl Pantofl"
    End If
    End Sub
     
    Private Sub Timer2_Timer()
    ProgressBar1.Value = ProgressBar1.Value + 10
    If ProgressBar1.Value = "200" Then
    Label1.Caption = "uber roflpantofl"
    End If
    End Sub
    I use vb6.
    hi

    declare your progressbar.val ue as value, not as string !
    If ProgressBar1.Va lue = "90" Then
    should be
    If ProgressBar1.Va lue = 90 Then

    look at your progressbar property: max and min
    values should lay between those 2 values

    in case the progressbar.val ue should exceed the max-value
    build an errortrap such as


    if Newvalue>Progre ssbar.Max then
    Newvalue=Progre ssbar.Min
    else
    ProgressBar.Val ue=NewValue
    endif

    Comment

    Working...