我启动我的Windows计时器,并试图阻止,但似乎并不奏效,请参阅我的代码:再次定时器如何在.net中工作?
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("Hello");
timer1.Stop();
}
它一遍又一遍地显示了消息,并没有停止。请给我一些想法,我非常感谢你的帮助。
也许这个链接将帮助你解决你的问题。 http://stackoverflow.com/questions/4563704/c-sharp-how-do-you-stop-a-timer – Joseph
这将帮助您了解http://stackoverflow.com/a/4563738/5001784 –