countdown timer problem!

.NET programming topics
Post Reply
aksl
Sergeant
Sergeant
Posts: 20
Joined: Wed Jan 29, 2014 9:34 pm
Location: Kurunegala,Srilanka

countdown timer problem!

Post by aksl » Sat Feb 15, 2014 9:44 pm

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! :( :( :( :( :( :( :( :( :(
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: countdown timer problem!

Post by Neo » Tue Feb 18, 2014 10:57 pm

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
aksl
Sergeant
Sergeant
Posts: 20
Joined: Wed Jan 29, 2014 9:34 pm
Location: Kurunegala,Srilanka

Re: countdown timer problem!

Post by aksl » Sun Feb 23, 2014 5:47 am

ok,a best article link for me .thanks!
:clap: :clap: :clap: :clap: :clap: :clap:
Post Reply

Return to “.NET Programming”