Jeremy Martin
Dec 22nd, 2002, 03:19 PM
I have to following code:
System.Windows.Forms.Timer onCheckTimer = new System.Windows.Forms.Timer();
onCheckTimer.Tick += new EventHandler(checkOnTimer);
Console.WriteLine("Startin TImer...");
onCheckTimer.Interval = 1000;
onCheckTimer.Start();
static void checkOnTimer(Object myObject, EventArgs myEventArgs)
{
Console.WriteLine(DateTime.Now.ToString());
}
My question is does anyone know why the timer event never gets raised. I took it from the msdn documentation but can't seem to get it work work. The first part of the code is from a console app called and the function would be main.
If anyone has any insight then I would be exteremly greatfull.
Jeremy
System.Windows.Forms.Timer onCheckTimer = new System.Windows.Forms.Timer();
onCheckTimer.Tick += new EventHandler(checkOnTimer);
Console.WriteLine("Startin TImer...");
onCheckTimer.Interval = 1000;
onCheckTimer.Start();
static void checkOnTimer(Object myObject, EventArgs myEventArgs)
{
Console.WriteLine(DateTime.Now.ToString());
}
My question is does anyone know why the timer event never gets raised. I took it from the msdn documentation but can't seem to get it work work. The first part of the code is from a console app called and the function would be main.
If anyone has any insight then I would be exteremly greatfull.
Jeremy