problem with winform timer in a user control

M

Michael Huslig

I have a C++.net user control which has two winform timers in it. When the
'poll' timer ticks, it stops itself, sends out a poll, and starts a 'retry'
timer. When the response to the poll (or an independant response) is
received, the poll timer and retry timer are stopped and the poll timer is
started again. If the retry timer times out, the poll is resent. One
instance of this control is put on each of several tab pages which can be
added or deleted by the end user.

The problem I have seems to be if I stop and then start a timer, I no longer
get any more tick events. In fact, I tried using just one timer, stopping
it and restarting it in the same routine, but I would get no more tick
events. I can stop and start an independant winform timer on the main form
without any problem. Am I having the problem because the poll and retry
timers are part of a user control?

From the documentation, stopping and starting a timer reinitializes the
timer to the time interval. But I can't find any information about whether
I have to stop the timer to change the time interval.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top