C# - how do you stop a timer?

前端 未结 7 1155
面向向阳花
面向向阳花 2020-12-08 09:44

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

7条回答
  •  一个人的身影
    2020-12-08 10:05

    System.Windows.Forms.Timer: timer.Enabled = false;
    System.Threading.Timer: timer.Change(Timeout.Infinite, Timeout.Infinite);
    System.Timers.Timer: timer.Enabled = false; or timer.Stop();

提交回复
热议问题