I wrote an application and I use 6 timers that should start one after another, but these timers do not work correctly. I don't know much about timers.
For example, the start of timer1 and something happens in the application. then timer1 should stop forever, and timer2 should start immediately, and something happens in the application. Then timer2 should stop forever, and timer3 should start, etc.
Please, help.
Here is my code:
int yyyy = 0; void move() { yyyy++; if (yyyy <= 1) { timer1.Start(); timer1.Interval = 15; timer1.Tick += new EventHandler(timer_Tick1); } if (yyyy <= 2) { timer2.Start(); timer2.Interval = 15; timer2.Tick += new EventHandler(timer_Tick2); } if (yyyy <= 3) { timer3.Start(); timer3.Interval = 15; timer3.Tick += new EventHandler(timer_Tick3); } if (yyyy <= 4) { timer4.Start(); timer4.Interval = 15; timer4.Tick += new EventHandler(timer_Tick4); } if (yyyy <= 5) { timer5.Start(); timer5.Interval = 15; timer5.Tick += new EventHandler(timer_Tick5); } if (yyyy <= 6) { timer6.Start(); timer6.Interval = 15; timer6.Tick += new EventHandler(timer_Tick6); } }
and: (for example, for timer2).
(all timers have exactly the same code below).
int t = 0; private void timer_Tick2(object sender, EventArgs e) { t++; if (t <= 150) {
source share