Hello,
I am writing a simple program. I want to select the date and time, it should appear like this: DAYS HOURS MINUTES SECONDS
when the time reached set date my timer must stop like this 0(d) 0(h) 0(m) 0(s) and show Form2. But my timer continues to count from 0 to negative. i dont know how can i stop the timer. Maybe this is something easy i just cant remember the syntax how to do it.. please help :)
Thanks in advance
Public Class Form1
Dim CurrentTime
Dim TargetTime
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = False
Timer1.Stop()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
CurrentTime = NowDim RemTime = TargetTime - CurrentTime
txtDays.Text = RemTime.days
txtHours.Text = RemTime.hours
txtMinutes.Text = RemTime.minutes
txtSeconds.Text = RemTime.seconds
End Sub
Private Sub btnOn_Click(sender As Object, e As EventArgs) Handles btnOn.Click
TargetTime = txtDateTime.Value
Timer1.Enabled = True
Timer1.Start()
txtDateTime.Visible = False
btnOn.Visible = False
End Sub
End Class