hello friend s i am making the simple timer module which will display time in count down format
as if user wnters 1 hour 3 mins and 30 sec so it will count in revers i have almost half code done but afer trying the all tricks and logic i didnt got any thing the out put is not proper as which i want
the code is as follows
Public Class Form1
Public hh As Integer
Public mm As Integer
Public ss As Integer
Public totalsec As Integer
Public timercount As Integer
Public temp As Integer
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
hh = Val(TextBox1.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
mm = Val(TextBox2.Text)
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
ss=Val(TextBox3 .Text )
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
totalsec = (hh * 3600) + (mm * 60) + ss
hh = totalsec / 3600
totalsec = totalsec - (hh * 3600)
mm = totalsec / 60
totalsec = totalsec - (mm * 60)
ss = totalsec
Label1.Text = hh.ToString
Label2.Text = mm.ToString
Label3.Text = ss.ToString
timercount = totalsec
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' totalsec = totalsec - 1
timercount = timercount - 1
temp = timercount
hh = temp / 3600
Label1.Text = hh.ToString
temp = temp - (hh * 3600)
mm = temp / 60
Label2.Text = mm.ToString
temp = temp - (mm * 60)
ss = temp
Label3.Text = ss.ToString
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = True
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Enabled = False
End Sub
End Class