I\'m trying to make a countdown using C# and show the time in format:
hour:minutes:seconds
I\'ve tried this:
var minutes
I would use a timer something like this. First a couple of instance variables.
private int _countDown = 30; // Seconds
private Timer _timer;
and in the constructor or load event
_timer = new Timer();
_timer.Tick += new EventHandler(timer_Tick);
_timer.Interval = 1000;
_timer.Start();
and then finally the event handler
void timer_Tick(object sender, EventArgs e)
{
_countDown--;
if (_countDown < 1)
{
_countDown = 30;
}
lblCountDown.Text = _countDown.ToString();
}