VB的定时循环问题
2个回答
2013-08-17
展开全部
可创建一个Timer控件Dim i As IntegerPrivate Sub Form_Load()
Timer1.Interval = 3000
End SubPrivate Sub Timer1_Timer() i = i + 1
Shell "d:\asd.exe" If i = 10 Then
Unload Me
End If
End Sub 以上是全部代码 另外借鉴楼上修改为(未测试)Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
For i = 1 To 10
Shell "d:\asd.exe"
Sleep 3000
Next i unload me
End Sub
Timer1.Interval = 3000
End SubPrivate Sub Timer1_Timer() i = i + 1
Shell "d:\asd.exe" If i = 10 Then
Unload Me
End If
End Sub 以上是全部代码 另外借鉴楼上修改为(未测试)Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
For i = 1 To 10
Shell "d:\asd.exe"
Sleep 3000
Next i unload me
End Sub
2013-08-17
展开全部
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
For i = 1 To 10
Shell "d:\asd.exe"
Sleep (3000)
Next
End Sub
Private Sub Command1_Click()
For i = 1 To 10
Shell "d:\asd.exe"
Sleep (3000)
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询