Tmer

  • Thread starter Thread starter Patrick De Ridder
  • Start date Start date
P

Patrick De Ridder

How do I get this to work?
Libraries to use etc.?
Thanks,
Patrick.

Timer timer = new Timer()
timer.Interval = 1000; // Once a second
timer.Tick += new EventHandler(OnTick);
timer.Enabled = true;
timer.Start();

protected void OnTick(object s, EventArgs ea)
{
MessageBox.Show("Tick Interval");
}
 
What is your problem? If one doesn´t know the problem it cannot be solved :)
Perhaps you just forget the ';' after Timer timer = new Timer() ;-)
Greetings, timtos.
 
Hi,

He is using System.Windows.Forms.Timer

System.Timers.Timer use the event Epalsed whether the one in Forms use Tick

The different according to MSDN is that the one in Windows.Form is
optimized for use in windows forms application.

Hope this help,
 
Not only.

System.Windows.Forms.Timer doesn't work when there is no form, e.g. in
Windows service.

Eliyahu
 
Ignacio Machin said:
System.Timers.Timer use the event Epalsed whether the one in Forms
use Tick
^^^^^^^^
wow, I've been doing this for a while now, but I've never come across
that "Epalsed" event. What raises it?

he he,
Scott
 
Scott said:
use Tick
^^^^^^^^
wow, I've been doing this for a while now, but I've never come across
that "Epalsed" event. What raises it?

he he,
Scott

Epalsed (elapsed?) whether (whereas?)
This looks like mistakes made by a dyslectic.
You owe Ignacio Machin an apology.

Patrick.
 
Back
Top