Hello Guys,
I need your help, ill try to fix this almost 2 weeks, but no success, i want to make a countdown timer from hour to minutes to seconds, example: 01:20:10, using that format, i want to make a countdown timer, and this is my code, but no luck. T,I.A.
Public Class countdown
Private Sub btnstart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstart.Click
Timer1.Enabled = True
lblhours.Text = txthours.Text
lblmins.Text = txtmins.Text
lblsecs.Text = txtsecs.Text
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static sec, min, hour As Double
sec = Val(lblsecs.Text)
sec -= 1
If sec <= 60 And sec >= 10 Then
lblsecs.Text = sec
ElseIf sec <= 10 And sec >= 1 Then
lblsecs.Text = "0" & sec
ElseIf sec = "00" Then
lblsecs.Text = "00"
End If
If lblsecs.Text = "00" Then
min = Val(lblmins.Text)
min -= 1
ElseIf min <= 60 And min >= 10 Then
lblmins.Text = min
ElseIf min <= 10 And min >= 1 Then
lblmins.Text = "0" & min
ElseIf min = "00" Then
lblmins.Text = "00"
End If
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
End Sub
End Class
Thanks in Advance Guys, I really need to fix it ASAP.
More Power Guys! :)