Home All Groups Group Topic Archive Search About

Re: Timer fires inconsistantely

Author
15 Apr 2006 6:59 AM
Cerebrus
Hi derSchweiz,

Your solution to the problem works, but wouldn't it have been simpler
to wire up the event to the handler outside the Button_Click event ?
Say, in your Sub New() ?

Regards,

Cerebrus.

Author
15 Apr 2006 8:56 PM
Michael D. Ober
Unless you have a specific reason to block the timer from firing, create the
timer "WithEvents" and then use the IDE to create the timer_elapsed handler.
Then you can avoid the AddHandler statement entirely.  In the timer
definition, set Enabled =False. Then in your Button handler, simply set the
timer's Enabled property to true.

Mike Ober.

Show quoteHide quote
"Cerebrus" <zorg***@sify.com> wrote in message
news:1145084382.962648.220390@z34g2000cwc.googlegroups.com...
> Hi derSchweiz,
>
> Your solution to the problem works, but wouldn't it have been simpler
> to wire up the event to the handler outside the Button_Click event ?
> Say, in your Sub New() ?
>
> Regards,
>
> Cerebrus.
>
>