Hi, I'm having a tough time here with the timer control. To illustrate the problem I'm having, I created a simple application. The application has a timer control, progress bar and 2 buttons.

What I'm trying to accomplish is that when I hit the Stop button, I want the timer to stop/reset and have the progress bar go back to starting position. Then, when I het the Start button, I want it to start over. Everything works fine EXCEPT that I can't get the Timer to reset. If I hit Stop and then Start, the time starts where it left of thus causing the progress bar to jump to the position it left off at when the Stop button was hit. However, if I let the progress bar continue until Max, it works fine.. It's only when I Stop it in the middle..

The problem seems to be that I can't manipulate the Static value from outside the Timer control. So that's why it is storing the last value and then continuing from that value.

I have included the code below so that you can test it yourself and hopefully come up with a solution for me.

Any and all help would be appreciated..

Code:
Private Sub Form_Load()

Timer1.Interval = 125
Timer1.Enabled = False
prgBar1.Max = 20

End Sub

Private Sub cmdStart_Click()
Timer1.Enabled = True
End Sub

Private Sub cmdStop_Click()
Timer1.Enabled = False
prgBar1.Value = prgBar1.Min
End Sub

Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
Static intTime
If IsEmpty(intTime) Then intTime = 0.125

prgBar1.Value = intTime

If intTime = prgBar1.Max Then
    Timer1.Enabled = False
    intTime = 0.125
    prgBar1.Value = prgBar1.Min
Else
    intTime = intTime + 0.125
End If
End Sub