如何运行计时器和2分钟后计时器停止自动? [英] how to run timer and after 2 minutes timer stop Automatic ?

查看:168
本文介绍了如何运行计时器和2分钟后计时器停止自动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想玩(timer1.enabled = true)........ 2分钟后(timer1.enabled = false)自动



请帮忙? ????

I want play (timer1.enabled = true) ........ after 2minutes (timer1.enabled = false) Automatic

please help ?????

推荐答案

这应该是微不足道的:



- 如果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.


这篇关于如何运行计时器和2分钟后计时器停止自动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆