timer1.interval=10000;
timer1.enabled=true;
private void timer1_Tick(object sender, EventArgs e)
{
//have to raise multiple events at a specific time interval
}
必须以2000 4000 6000 8000的时间间隔提出事件
答案 0 :(得分:0)
将间隔设置为2000,将EventHandler添加到Tick中,检查是否有要引发事件的侦听器,如果是,则使用所需的参数引发事件。
timer1.interval=2000;
timer1.enabled=true;
timer1.Tick += new EventHandler(timer_Tick);
timer1.Start();
void timer_Tick(object sender, EventArgs e)
{
if(YourEvent!=null)
YourEvent(this,YourEventArgs);
}