Results 1 to 3 of 3

Thread: Timer explanation

  1. #1

    Thread Starter
    Addicted Member soluga's Avatar
    Join Date
    Dec 2005
    Location
    Manchester (Uk)
    Posts
    211

    Resolved Timer explanation

    I have build a windows service, I have a timer and have set it's interval to every 10 secs for now, on the on start event I have set the timer to timer.start, so will this then activate the script every 10 seconds? or do I need to set anything else?
    There is no inverval event in 2005 just timer1.tick, do I need to put anything in here? apart from my code of course.
    Thanks
    Last edited by soluga; Aug 17th, 2006 at 08:14 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Timer explanation

    There are several different timers. The Windows.Forms.Timer has a Tick event while the Timers.Timer has an elapsed event, but they both have an Interval property. You set the Interval and the relevant event is raised each time that interval expires. You have to handle the Tick or Elapsed event and then put the code you wwant executed in the event handler.

    http://msdn.microsoft.com/msdnmag/is...T/default.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member soluga's Avatar
    Join Date
    Dec 2005
    Location
    Manchester (Uk)
    Posts
    211

    Re: Timer explanation

    Thanks, I changed to system.timer and works fine now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width