Alternatex
Alternatex

Reputation: 1552

How can I make a countdown timer?

I want to make a countdown timer in C#, WinForms. I want to be able to select a date from a DateTimePicker and make the timer count down to it showing remaining days, hours, minutes and seconds. How could I go about doing this?

Upvotes: 0

Views: 620

Answers (1)

walther
walther

Reputation: 13600

  1. Instantiate a timer object
  2. set the interval
  3. assign a handler for the "tick" event
  4. do your job:
    1. get the date
    2. calculate the remaining time

should do the trick.

Upvotes: 2

Related Questions