Cant get the timer working with windows Service.

D

dhulapati

I cant get the timer working with the windows service. I have the
timer set to 3600 ms. It polls only for Start and Stop but not at
intervals. The timer1.tick event handler is called at the
initializecomponent()
OnStart () enables the timer1 and OnStop() disables the timer1.

Can anybody help?
 
J

John Bailo

Did you add the event handler?

timer = new System.Timers.Timer(interval);
timer.Elapsed += new ElapsedEventHandler( this.ServiceTimer_Tick );
 
J

John Bailo

Oh, and you'll want to do that in the constructor /after/
InitializeComponent()
 

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