I have a form (Form1) and this form has a System.Timers.Timer object. I’d like to Invalidate the form (Basically this is my goal, to Invalidate (call Invalidate()) the form every once in a while where timeout period changes each time when event is triggered). However since event handler method is static, I don’t have access to instance of my form.
How can I pass some objects to my event handler?
This is pretty simple, the winforms timer is a component which means you can drag and drop a timer onto your form. Use the properties grid to enable the time and set the timer interval. Change the property grid to display the events and double click the tick event. A new event handler will be created for you.