How Do I Reset the Timer in Visual Basic?
How Do I Reset the Timer in Visual Basic?
(OP)
I have the following code:
Private Sub cmdDisplay_Click()
Dim intZone1 As Integer
Dim intZone2 As Integer
Dim intZone3 As Integer
Dim intZone4 As Integer
intZone1 = 1
intZone2 = 2
intZone3 = 3
intZone4 = 4
If (txtID.Text = 1) Then
txtFinalZone.Text = intZone1
End If
If (txtID.Text = 2) Then
txtFinalZone.Text = intZone2
End If
If (txtID.Text = 3) Then
txtFinalZone.Text = intZone3
End If
If (txtID.Text = 4) Then
txtFinalZone.Text = intZone4
End If
If (txtID.Text = 0) Then
Call Timer1_Timer
Else
If (txtID.Text = 1) Then
Reset Timer "I WANT TO RESET THE TIMER IN THIS LINE"
"HOW CAN I DO THAT?"
End If
End If
End Sub
Private Sub Timer1_Timer()
Call Beep
End Sub
THANKS IN ADVANCE
Private Sub cmdDisplay_Click()
Dim intZone1 As Integer
Dim intZone2 As Integer
Dim intZone3 As Integer
Dim intZone4 As Integer
intZone1 = 1
intZone2 = 2
intZone3 = 3
intZone4 = 4
If (txtID.Text = 1) Then
txtFinalZone.Text = intZone1
End If
If (txtID.Text = 2) Then
txtFinalZone.Text = intZone2
End If
If (txtID.Text = 3) Then
txtFinalZone.Text = intZone3
End If
If (txtID.Text = 4) Then
txtFinalZone.Text = intZone4
End If
If (txtID.Text = 0) Then
Call Timer1_Timer
Else
If (txtID.Text = 1) Then
Reset Timer "I WANT TO RESET THE TIMER IN THIS LINE"
"HOW CAN I DO THAT?"
End If
End If
End Sub
Private Sub Timer1_Timer()
Call Beep
End Sub
THANKS IN ADVANCE
RE: How Do I Reset the Timer in Visual Basic?
RE: How Do I Reset the Timer in Visual Basic?
Timer1.Enable = False
Timer1.Enable = True
That will reset the timer and then start it again from 0
RE: How Do I Reset the Timer in Visual Basic?
Cheers
Greg Locock
RE: How Do I Reset the Timer in Visual Basic?
Disabling and the re-enabling restarts the timer from 0