public int hours = 00; // Hours.
public int minutes = 10; // Minutes.
public int seconds = 00; // Seconds.
private void timer1_Tick(object sender, EventArgs e)
{
if (seconds < 1)
{
seconds = 59;
if (minutes == 0)
{
minutes = 59;
if (hours != 0) hours -= 1;
}
else
{
minutes -= 1;
}
}
else seconds -= 1;
lblHr.Text = hours.ToString();
lblMin.Text = minutes.ToString();
lblSec.Text = seconds.ToString();
}
private void CountDownTimer1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
thank you dear this is very help full exampl....
ReplyDeletethnx for using this blog if any kind of help in c# windows application and asp.net mail me
ReplyDeletecan u help me on 1 hours countdown in C# windows application
ReplyDeletetell me what is your issue i can help
Delete