日期:2014-05-20 浏览次数:20764 次
public partial class Form1 : Form { int i = 0; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { timer1.Enabled = true; timer1.Interval = 1000; } private void timer1_Tick(object sender, EventArgs e) { i++; MessageBox.Show(i.ToString()); if (i >= 5) timer1.Enabled = false;//timer停止 } }