请问如何让这段VB代码5秒循环一次
请问如何让这段代码不成立时5秒后重复检测是否成立,一直到成立为止。PrivateSubForm_Load()IfcConnect.IsConnectedThenShell...
请问如何让这段代码不成立时5秒后重复检测是否成立,一直到成立为止。
Private Sub Form_Load()
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
End If
End Sub
答对两个分都给
http://zhidao.baidu.com/question/73067162.html 展开
Private Sub Form_Load()
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
End If
End Sub
答对两个分都给
http://zhidao.baidu.com/question/73067162.html 展开
1个回答
展开全部
把下面的代码用记事本保存成Form1.frm
====================
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Interval = 5000
Left = 1080
Top = 720
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Me.Visible = False
End Sub
Private Sub Timer1_Timer()
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
Timer1.Enabled=False
End If
End Sub
====================
很简单呀,加一个Timer1.Enabled=False就行了
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
Timer1.Enabled=False
End If
顺便问一句,你是网管吗?
====================
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Interval = 5000
Left = 1080
Top = 720
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Me.Visible = False
End Sub
Private Sub Timer1_Timer()
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
Timer1.Enabled=False
End If
End Sub
====================
很简单呀,加一个Timer1.Enabled=False就行了
If cConnect.IsConnected Then
Shell "C:\Program Files\wxyrun.exe", vbNormalFocus
Timer1.Enabled=False
End If
顺便问一句,你是网管吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询