一个timer控制闪灯的程序,如何延时10s后?
时间:2011-11-12
来源:互联网
Private Sub Timer2_Timer() '闪灯程序
Ima1.Item(Timepp - 1).Visible = Not Ima1.Item(Timepp - 1).Visible
在这里如何写一个延时函数,最好不是sleep,怕占线程
ima1.item(timepp-1).visible=true
end sub
作者: zhaoming0418 发布时间: 2011-11-12
Private Sub Form_Load() Timer2.Interval = 1000 End Sub Private Sub Timer2_Timer() '闪灯程序 Static sum As Long sum = sum + 1 ima1.Item(timepp - 1).Visible = Not ima1.Item(timepp - 1).Visible '在这里如何写一个延时函数,最好不是sleep,怕占线程 If sum Mod 600 Then ima1.Item(timepp - 1).Visible = True sum = 0 End If End Sub
作者: zdingyun 发布时间: 2011-11-12
VB code
Private Sub Form_Load() Timer2.Interval = 1000 End Sub Private Sub Timer2_Timer() '闪灯程序 Static sum As Long sum = sum + 1 ima1.Item(timepp - 1).Visible = Not ima1.Item(timepp - 1).Visible '在这里如何写一个延时函数,最好不是sleep,怕占线程 If sum Mod 60 = 0 Then ima1.Item(timepp - 1).Visible = True sum = 0 End If End Sub
作者: zdingyun 发布时间: 2011-11-12
VB code
Private Sub Form_Load() Timer2.Interval = 1000 End Sub Private Sub Timer2_Timer() '闪灯程序 Static sum As Long sum = sum + 1 ima1.Item(timepp - 1).Visible = Not ima1.Item(timepp - 1).Visible '在这里如何写一个延时函数,最好不是sleep,怕占线程 If sum Mod 600 = 0 Then ima1.Item(timepp - 1).Visible = True sum = 0 End If End Sub
作者: zdingyun 发布时间: 2011-11-12
作者: zhaoming0418 发布时间: 2011-11-12
Private Sub Timer2_Timer() '闪灯程序
Static sum As Long
sum = sum + 1
Ima1.Item(Timepp - 1).Visible = Not Ima1.Item(Timepp - 1).Visible
'在这里如何写一个延时函数,最好不是sleep,怕占线程
If sum Mod 600 = 0 Then
Ima1.Item(Timepp - 1).Visible = True
sum = 0
End If
Ima1.Item(Timepp - 1).Visible = True ‘我想延时十秒之后让这个灯就常亮了
End Sub
作者: zhaoming0418 发布时间: 2011-11-12
作者: Veron_04 发布时间: 2011-11-12
大侠,没延时啊。
我的代码仅提供一个思路:
VB code
Private Sub Form_Load() Timer3.Interval = 1000 Timer3.Enabled = False End Sub Private Sub Timer3_Timer() '闪灯程序 Static sum As Long sum = sum + 1 '在这里如何写一个延时函数,最好不是sleep,怕占线程 If sum Mod 600 = 0 Then sum = 0 ima1.Item(timepp - 1).Visible = True Timer2.Enabled = False Timer3.Enabled = False End If End Sub Private Sub Timer2_Timer() '闪灯程序 ima1.Item(timepp - 1).Visible = Not ima1.Item(timepp - 1).Visible '在这里如何写一个延时函数,最好不是sleep,怕占线程 Timer3.Enabled = True End Sub
作者: zdingyun 发布时间: 2011-11-12
VB code
Private Sub Command1_Click() Timer2.Enabled = True End Sub Private Sub Form_Load() Timer3.Interval = 1000 Timer3.Enabled = False End Sub Private Sub Timer3_Timer() '闪灯程序 Static sum As Long sum = sum + 1 '在这里如何写一个延时函数,最好不是sleep,怕占线程 If sum Mod 10 = 0 Then sum = 0 Shape1.Visible = True Timer2.Enabled = False Timer3.Enabled = False End If End Sub Private Sub Timer2_Timer() '闪灯程序 Shape1.Visible = Not Shape1.Visible '在这里如何写一个延时函数,最好不是sleep,怕占线程 Timer3.Enabled = True End Sub
作者: zdingyun 发布时间: 2011-11-12
作者: zhaoming0418 发布时间: 2011-11-12
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28