Timer control is required
Timer1.interval
Events triggered when timer1.tick reaches the time interval
Test_tick time processing function
Timer1.tick + = new system. eventhandler (test_tick );
Delegate to process events. Generally, you can add the above Code to the component function of the form constructor initializecomponent constructor interface to register the test_tick handler function;
Of course, you don't have to worry about this. Double-click the timer control in the form view, and the system will automatically generate a processing function similar to test_tick.
Generally, you need to use timer1.start (); // start the timer timer1.stop ();. // disable the timer method.
The general code process is as follows:
Private void form_load (Object sender, eventargs e) {timer1.interval = 1000; timer1.start ();} private void test_tick (...) {// The function body to be executed every second. The function will be executed every second after timer start}