stop a timer

kenobe

New member
Joined
Jan 13, 2010
Messages
3
Programming Experience
Beginner
Hi
Can someone pls help to solve my problem?

I have started a timer when I press a button

my question is "Can I stop the timer in the timer_tick(..) sub?
I try this inside the timer1_tick(..) suib
timer1.stop()
It does not work.

my timer_tick routine is doing something, when it is done, the timer should stop. How do I do it?
 
Hi
Can someone pls help to solve my problem?

I have started a timer when I press a button

my question is "Can I stop the timer in the timer_tick(..) sub?
I try this inside the timer1_tick(..) suib
timer1.stop()
It does not work.

my timer_tick routine is doing something, when it is done, the timer should stop. How do I do it?

can u provide the code
and use another button to stop timer
 
It is too much to put the code here.
In shor, the code involves receiving data from the serial port and at the same time, a timer is ticking some process. will this arrangement conflict each other?
 
my timer_tick routine is doing something, when it is done, the timer should stop.
That's probably your problem. Call Stop at the beginning of the Tick event handler, not the end. Otherwise it may be raising more Tick events while the first event handler is still processing.
 
Back
Top