Hi, I have a issues, in this code I have a countdown with function declared, the issues now is that, if starting the time with only seconds timer go well but if the timer go to one minute if button is clicked timer suddently stop. Is there anything wrong with the code?
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If Label5.Text = 0 AndAlso Label8.Text = 0 AndAlso Label7.Text < 59 Then
Label7.Text = Label7.Text - 1.ToString
If Label5.Text = 0 AndAlso Label8.Text = 0 AndAlso Label7.Text = 0 Then
Timer1.Stop()
MsgBox("timer out", MessageBoxButtons.OK)
End If
If Label7.Text = 0 AndAlso Label8.Text > 1 Then
Label8.Text = Label8.Text - 1.ToString
Label7.Text = 59
ElseIf Label5.Text >= 0 AndAlso Label8.Text >= 0 AndAlso Label7.Text = 59 Then
Label7.Text = 59
Label8.Text = 59
Label7.Text = Label7.Text - 1.ToString
Label8.Text = Label8.Text - 1.ToString
Label5.Text = Label5.Text - 1.ToString
End If
End If
End Sub