【发布时间】:2015-07-23 07:38:07
【问题描述】:
我需要在 Geckofx 33 网络浏览器中完成文档处理 壁虎 isbusy 功能不起作用 StatusText 也是
<i>
web.navigate("http://google.com")
msgbox(web.isbusy) ' this return False '
</i>
【问题讨论】:
我需要在 Geckofx 33 网络浏览器中完成文档处理 壁虎 isbusy 功能不起作用 StatusText 也是
<i>
web.navigate("http://google.com")
msgbox(web.isbusy) ' this return False '
</i>
【问题讨论】:
如果 'web' 是你的 geckowebbrowser,那么就这样做:
web.DocumentCompleted += web_DocumentCompleted;
void web_DocumentCompleted(object sender, GeckoDocumentCompletedEventArgs e)
{
//do stuff here
}
另外,不要检查“isbusy”,而是尝试为“web.navigating”使用类似的事件处理程序。
【讨论】:
IsBusy 不是在您使用 Navigate 之后立即成为 True。
在我的代码中,我等待一段时间(1 秒),然后创建循环:
Private Sub wait(ByVal interval As Integer)
Dim sw As New Stopwatch
sw.Start()
Do While sw.ElapsedMilliseconds < interval * 1000
Application.DoEvents()
If IBW.CancellationPending = True Then Exit Do
Loop
sw.Stop()
End Sub
Web.Navigate("http://google.com")
'Now wait for 1 second before checking IsBusy
wait(1) : Do While IWeb.IsBusy = True : Application.DoEvents() : Loop
【讨论】: