Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Timer stop working???

Timer stop working???

Scheduled Pinned Locked Moved C#
csharphelpquestionannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Small Rat
    wrote on last edited by
    #1

    Hi, I put a timer control in a form. I start it (tm.enabled=true) at the contstructor. It works well. but later on, I use the code like this: tm.Interval=2000; //(different value) tm.Start(); But the timer stop ticking??? Why??? I have to change the interval dynamically. please help me!! Thanks!!! Alan Shen MCAD for .NET Version ^~^~^~^~^~^~^~^~^~^~^ Great idea is the beginging of success!

    J 1 Reply Last reply
    0
    • S Small Rat

      Hi, I put a timer control in a form. I start it (tm.enabled=true) at the contstructor. It works well. but later on, I use the code like this: tm.Interval=2000; //(different value) tm.Start(); But the timer stop ticking??? Why??? I have to change the interval dynamically. please help me!! Thanks!!! Alan Shen MCAD for .NET Version ^~^~^~^~^~^~^~^~^~^~^ Great idea is the beginging of success!

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Just a guess, but you may have to stop the timer before changing its interval.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      S 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Just a guess, but you may have to stop the timer before changing its interval.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        S Offline
        S Offline
        Small Rat
        wrote on last edited by
        #3

        thx, I solve the problem by using System.Timers.Timer instead of System.Windows.form.Timer. I have no time to find out what is the difference between them . but I think it should not happen. thx again!! Alan Shen MCAD for .NET Version ^~^~^~^~^~^~^~^~^~^~^ Great idea is the beginging of success!

        R 1 Reply Last reply
        0
        • S Small Rat

          thx, I solve the problem by using System.Timers.Timer instead of System.Windows.form.Timer. I have no time to find out what is the difference between them . but I think it should not happen. thx again!! Alan Shen MCAD for .NET Version ^~^~^~^~^~^~^~^~^~^~^ Great idea is the beginging of success!

          R Offline
          R Offline
          Robert M Greene
          wrote on last edited by
          #4

          http://msdn.microsoft.com/msdnmag/issues/04/02/TimersinNET/[^] ............................. There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life. Fiat justitia, et ruat cælum

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups