在运行timer事件前设置个标志,运行一次后修改这个标志,判断这个标志不就可以了?
解决方案 »
- LOTUS 提示错误,急求解决,各位专家!
- 请问如何向鼠标当前所在位置发送鼠标单击消息
- 用ado连接数据库然后排序
- 关于Rthereshold=1 InputLen=1时触发了几次OnComm的讨论!
- 代码优化
- 使用DataReport生成的报表,在本机上好好的,换了个机器总是提示"Invalid Data Source"
- 当用户按下ok与按下cancel是vb中执行的语句各是什么? 用户如何从一个form的执行后得到一定的返回值?比如一个String变量
- webbrowser控件打开网页出现“脚本错误”问题
- 数据报表中,这样的设计思路正确吗?
- 有人说CSDN的同志们网恋都不可能成功,俺可是网恋成功了,CSND上的妹妹啊,谢谢啦!
- 请问怎样不用控件下载东西啊。
- 怎么样实现单击一个命令按扭打开一个网页!
Dim n As IntegerPrivate Sub Timer1_Timer()
n = n + 1
If n = j Then Timer1.Enabled = False ‘j为次数
End Sub
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
PauseTime = 5 ' 设置暂停时间。
Start = Timer ' 设置开始暂停的时刻。
Do While Timer < Start + PauseTime
DoEvents ' 将控制让给其他程序。
Loop
Finish = Timer ' 设置结束时刻。
TotalTime = Finish - Start ' 计算总时间。
MsgBox "Paused for " & TotalTime & " seconds"
Else
End
End If
Dim i, j As Integer
i = 1
Timer1.Interval = 500
End SubPrivate Sub Timer1_Timer()
i = i + 1
If i = 2 * j Then
Frame2.Visible = False
Frame1.Visible = True
Else
Frame1.Visible = False
Frame2.Visible = True
End If
End Sub这个代码那里错了,运行后没有预期的目的
是不是我表示偶数的方法不对?应该怎么写?
Dim i as Integer, j As IntegerPrivate Sub Form_Load()
i = 1
Timer1.Interval = 500
j=5
End SubPrivate Sub Timer1_Timer()
i = i + 1
If i = 2 * j Then
Frame2.Visible = False
Frame1.Visible = True
Else
Frame1.Visible = False
Frame2.Visible = True
End If
timer1.enable=false
End Sub
谢谢了,我的意思是,我希望,当i为偶数的时候,frame1可见,i为奇数的则frame2可见,也就是让frame1,2交替出现,我写的代码错在哪里?
Dim i As booleanPrivate Sub Form_Load()
Timer1.Interval = 500
End SubPrivate Sub Timer1_Timer()
i = not i
If i Then
Frame2.Visible = False
Frame1.Visible = True
Else
Frame1.Visible = False
Frame2.Visible = True
End If
End Sub
Private Sub Timer1_Timer()
n = n + 1
If n = j Then
Timer1.Enabled = False 'j为次数
Else
*******
*******
End If
End Sub