>System.Windows.Forms.Timer tmrCheckStuff = new System.Windows.Forms.Timer(); >this.tmrCheckStuff.Interval = 4000; // about 4 seconds >this.tmrCheckStuff.Start; >or >this.tmrCheckStuff.Enabled = true; >>If I need to stop if for a moment while something else occurs, then restart it that is pretty easy. But if I use a Threading.Timer, how do I do this?
>AutoResetEvent autoEvent = new AutoResetEvent(false); >TimerCallback timerDelegate = new TimerCallback(MyStuffClass.DoStuffMethod); >private System.Threading.Timer tmrCheckStuff = new System.Threading.Timer(timerDelegate, autoEvent, 90000, 5000); > >I can change the time with: >autoEvent.WaitOne(5000, false); >tmrCheckStuff.Change(0, 9000); >>