1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
private System.Timers.Timer timer;
...
private void InitializeComponent( ){
this.timer = new System.Timers.Timer();
...
((System.ComponentModel.ISupportInitialize)(this.timer)).BeginInit();
...
this.timer.Interval = 1000;
this.timer.SynchronizingObject = this;
this.timer.Elapsed += new System.Timers.ElapsedEventHandler(this.timer_Elapsed);
...
((System.ComponentModel.ISupportInitialize)(this.timer)).EndInit();
...
}
private void fonctionX(){
timer.start();
} |