Page 1 of 1

countdown timer problem!

Posted: Sat Feb 15, 2014 9:44 pm
by aksl
I found the following countdown timer code from another web site. It works pretty good.

1 Dim startdate As DateTime = DateTime.Parse(Date.Now)
2 Dim enddate As DateTime = DateTime.Parse("20104-02-24 18:00")
3 Dim ts As TimeSpan = enddate.Subtract(startdate)
4 Label1.Text = CStr(ts.Days) & " Days, " & CStr(ts.Hours) & " Hours, " & CStr(ts.Minutes) & " minutes, " & CStr(ts.Seconds) & " seconds!"

please give me a code to stop timer on end date & open another form (ex: form 3)on that day automatically.

thaks in advance! :( :( :( :( :( :( :( :( :(

Re: countdown timer problem!

Posted: Tue Feb 18, 2014 10:57 pm
by Neo
First of all, yours is not a countdown timer code. It just show the difference between two times. If you need to make a countdown timer, you need a timer control that continuously trigger a function. This is a good tutorial to do this.

Add a Countdown Timer

Re: countdown timer problem!

Posted: Sun Feb 23, 2014 5:47 am
by aksl
ok,a best article link for me .thanks!
:clap: :clap: :clap: :clap: :clap: :clap: