第1个回答 2011-06-18
首先。Net有好几种timer,用在UI上的推荐System.Windows.Forms.Timer这个。
参考代码如下:
this.timer1 = this.timer1 = new System.Windows.Forms.Timer();
this.timer1.Interval = 2000;
this.timer1.Tick += new EventHandler(timer1_Tick);
void timer1_Tick(object sender, EventArgs e)
{
// 自动浏览code,每隔一定时间会自动触发这个函数。
}
private void button1_Click(object sender, EventArgs e)
{
this.timer1.Start();
}本回答被提问者采纳