【发布时间】:2013-03-21 14:18:24
【问题描述】:
我有一个应用程序,它会根据我选择的速度每秒自动为我点击 1 次按钮。但是,它超时了,所以我需要向此页面添加刷新。我需要在多次点击后停止我的timer1 并拥有一个WebBrowser1.Refresh(),然后一旦刷新完成,timer1 就会随着点击而启动,并且该过程再次完成。我不知道如何开始这个,因为我以前从来没有停止过计时器,但我一直在阅读它,它看起来相对容易。这是我正在使用的脚本:
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked = True Then
Timer1.Interval = 40
ElseIf RadioButton2.Checked = True Then
Timer1.Interval = 100
Else
Timer1.Interval = 500
End If
If ((WebBrowser1.IsBusy)) Then
Else
WebBrowser1.Document.GetElementById("NewGamertag").SetAttribute("value", txtTurbo.Text)
Timer1.Start()
End If
End Sub
如你所见,一旦按钮被点击一次,它就会一遍又一遍地执行Timer1.Start(),在Timer1.start()的代码中你可以看到点击一次的代码:
WebBrowser1.Document.GetElementById("claimIt").InvokeMember("Click")
哪个有效,但我需要在多次点击/秒后停止我的Timer1 并刷新网络浏览器。我不知道如何开始,如果有人能引导我走上正确的轨道,我会很感激的。 (抱歉语法不好/句子跑题,我是英语新手)
【问题讨论】: