On Jun 30, 3:54*pm, "Elliot" <elliot_barc...@hotmail.co.ukwrote:
My program use a timer to 'refresh' a method "a" every several seconds,
* * * * private void a(object sender, EventArgs eArgs)
* * * * {
* * * * * * * * * * * * * * * * Timer T1 = new Timer();
* * * * * * * * * * * * * * * * T1.Interval = 100000;
* * * * * * * * * * * * * * * * T1.Start();
* * * * * * * * * * * * * * * * T1.Tick += new EventHandler(b);
* * * * * * * * * * * * * * * * Timer T2 = new Timer();
* * * * * * * * * * * * * * * * T2.Interval = 100000;
* * * * * * * * * * * * * * * * T2.Start();
* * * * * * * * * * * * * * * * T2.Tick += new EventHandler(c);
* * * * }
Inside "a", there are two timers.
My question is how can I stop timers T1 & T2 before refreshing "a" for a new
time?
Thanks for any idea.
You need to have a reference to them, in other words declare them at
the class level, not inside the method
but what are you trying to do? Those many timers are really necesary?