private void ShutDownTm_Tick(object sender, EventArgs e) { timeLeft = timeLeft.Subtract(TimeSpan.FromSeconds(1)); lblTimer.Text = timeLeft.ToString(@"hh\:mm\:ss"); if (timeLeft.TotalSeconds <= 0) { ShutDownTm.Stop(); PerformAction(); } }
private void button2_Click(object sender, EventArgs e) { ShutDownTm.Stop(); }