C# - how do you stop a timer?

2019-01-17 09:05发布

I know it sounds stupid, but I've tried everything to stop a timer, but the timer won't stop. I'm working on a game and i would appreciate if someone could tell me how to stop a timer.

标签: c# .net timer
7条回答
手持菜刀,她持情操
2楼-- · 2019-01-17 10:05

Assuming you are making use of the System.Windows.Forms.Timer; since there was no explicit reference to anything else...if that is the case...

System.Windows.Forms.Timer myTimer = new System.Windows.Forms.Timer();
myTimer.Stop(); 
查看更多
登录 后发表回答