1. Start the second timer in timer1 after 20 seconds using sleep() method.
2. Stop the timer1 in timer2.
int count = 1;
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
textBox1.Text = "Button1 Clicked at " + DateTime.Now.ToString();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (count == 1)
{
textBox1.Text = textBox1.Text + Environment.NewLine + "Timer1 Enabled at " + DateTime.Now.ToString();
}
if (count == 17)
{
timer2.Start();
}
count++;
}
private void timer2_Tick(object sender, EventArgs e)
{
timer1.Stop();
textBox1.Text = textBox1.Text + Environment.NewLine + "Timer2 Enabled at " + DateTime.Now.ToString();
}
}
Interval of timer1 is 1000 and timer2 is 4000.