I am creating a
System.Timers.Timer aTimer = new System.Timers.Timer();
and want to access the main form, or Form1 from the
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{...}
event, how do I do this? I can’t find an example online, via google, that does this. I am drawing some graphics and want to change them when the timer event fires. I can’t use the form timer as I want to port this code to something else and it won’t be available.
Thanks
I don’t like the following code very much, but if you cannot find another way of getting a reference to your
Form1instance into the event handler, you could try it viaApplication.OpenForms: