且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何运行计时器和2分钟后计时器停止自动?

更新时间:2023-12-04 08:41:58

这应该是微不足道的:



- 如果2分钟是计时器间隔,然后在触发自己的事件时停用它。

- 如果timer1的时间限制超过2分钟,则在同一时刻启动timer2并在timer2获取时停用timer1 * b $ b

自己尝试(如果遇到问题或有问题),然后使用改善问题小部件来显示您正在尝试的代码。然后我们可以纠正/解释你的错误。为您提供随时可用的解决方案无助于您学习。学习是Codeproject的主要目标。
That should be trivial:

- If the 2 minutes are the Timer interval, then just deactivate it when its own event get triggered.
- If the timer1 has a time-limit other than 2 minutes, then start a timer2 in the very same moment and deactivate timer1 when timer2 gets trigered.

Try it on your own and (if you get stuck or have problems) then use the "improve question" widget to show the code you are trying. Then we can correct / explain you the error. Giving you a "ready-to-go" solution won't help you to learn. And learning is the main target of Codeproject.