暂停计时器控制一定时间 [英] Pause timer control for certain time

查看:155
本文介绍了暂停计时器控制一定时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我正在使用2个计时器控件在Windows应用程序的同一位置上显示Flash和图片广告.当我将2个计时器控件的时间间隔设置为不同时,它们可以随时相等(例如,timer1 = 10秒间隔,timer2 = 5秒)它们在10秒后间隔相等,所以有冲突来显示闪光灯或图像),所以我想对两个控件使用相同的时间间隔,例如20秒,但是我想在10秒后启动timer2,因此没有冲突问题如果有人知道的话,在任何时候该怎么做.
帮帮我.

Hi I am using 2 timer controls to display flash and image ads on the same location in windows application.when i set the different time intervals to 2 timer controls they may equal at any time(for example timer1=10 sec interval and timer2=5 sec interval they are equal after 10 sec so there is a collision to display either flash or image)so i wanted to use same time interval for both the controls say 20 sec but i wanted to start timer2 after 10 seconds, so there is no collision issue at any time how to do that if any one knows please.
Help me.

推荐答案

这是您的答案
1.添加另一个计时器控件,例如timer3
2.设置timer3时间间隔10秒
3.设置timer1,将timer3启用为true,将timer2启用为false
4.在timer3_Tick事件中,设置为禁用timer3并启用timer2.

希望这能解决您的问题.
Here is your answer
1. Add another timer control say timer3
2. set timer3 time interval 10 sec
3. set timer1, timer3 enabled true and timer2 enabled false
4. in timer3_Tick event set timer3 disabled and timer2 enabled.

Hope this will solve your problem.


这篇关于暂停计时器控制一定时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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