int i;
private void Button1_Click(object sender, EventArgs e)
{
i = 45;
label1.Text = i.ToString();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Start();
}
private void Timer1_Tick(object sender, EventArgs e)
{
label1.Text = (--i).ToString();
if (i < 0)
timer1.Stop();
}
int i;
int tk;
string c;
private void Button1_Click(object sender, EventArgs e)
{
i = 300;
c ="5:00";
label1.Text = c;
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Start();
}
private void Timer1_Tick(object sender, EventArgs e)
{
tk = --i;
TimeSpan span = TimeSpan.FromMinutes(tk);
string label = span.ToString(@"hh\:mm");
label1.Text = label.ToString();
if (i < 0)
timer1.Stop();
}