vb怎样实现每隔298秒自动点击一次command1按钮?
4个回答
展开全部
Dim i As Integer
Private Sub Command1_Click()
MsgBox "12345"
End Sub
Private Sub Form_Load()
i = 0
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i >= 298 Then
i = 0
Command1_Click
End If
End Sub
Private Sub Command1_Click()
MsgBox "12345"
End Sub
Private Sub Form_Load()
i = 0
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i >= 298 Then
i = 0
Command1_Click
End If
End Sub
展开全部
Dim N As Integer
Dim M As Integer
Public Sub Command1_Click()
M = M + 1
MsgBox "第" + CStr(M) + "次单击"
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
N = 0
M = 0
End Sub
Private Sub Timer1_Timer()
N = N + 1
If N = 298 Then
Call Form1.Command1_Click
N = 0
End If
End Sub
注意按钮的过程是Public
Dim M As Integer
Public Sub Command1_Click()
M = M + 1
MsgBox "第" + CStr(M) + "次单击"
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
N = 0
M = 0
End Sub
Private Sub Timer1_Timer()
N = N + 1
If N = 298 Then
Call Form1.Command1_Click
N = 0
End If
End Sub
注意按钮的过程是Public
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
加计时控件TIMER
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s
s = 0
If s < 298 Then
s = s + 1
Else
s = 0
Call Command1_Click
End If
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Dim s
s = 0
If s < 298 Then
s = s + 1
Else
s = 0
Call Command1_Click
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Timer1.Interval=298000
然后在Timer1_Timer事件中:
Call command1_click
然后在Timer1_Timer事件中:
Call command1_click
追问
Timer1.Interval最大只能6000多啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询