Calling Timer Tick Event with Custom EventArg

Dec 5 2006 3:40 PM
Hi All,

I want to create a timer tick event but pass an argument to the event. I am getting stuck in how to pass the custom EventArgs to the tick event. The code below with the missing lines compiles with one error, because the "Clock.Tick +=" line is missing the information on the argument. I just don't know how to pass it.

Thanks in advance,

Marci Weinberger

...
MyEventArgs objEventArgs;
objEventArgs = new MyEventArgs(iBoard);

Clock = new System.Windows.Forms.Timer();
Clock.Interval = 1000;
Clock.Start();
Clock.Tick += new EventHandler(Timer_Tick);

...

private void Timer_Tick(object sender, MyEventArgs objArgs)
{
}