C# - how do you stop a timer?

前端 未结 7 1152
面向向阳花
面向向阳花 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

    Depends on the timer. If it is from threading namespace, dispose of it and recreate it when you need to, or have your timer delegate wait on reset event(see msdn). System.Timers namespace has a start and stop method.

提交回复
热议问题