C# - how do you stop a timer?

前端 未结 7 1136
面向向阳花
面向向阳花 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 09:58

    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(); 
    

提交回复
热议问题