我希望我的应用程序等到网络浏览器完全加载,以便我可以使用DocumentCompleted
事件,但问题是我使用的是awesmoium webkit并且LoadingFrameComplete
事件不会触发。当我在google上像谷歌一样搜索谷歌并搜索“VB.NET”#39;它没有被解雇所以我想暂停address changed
事件并等到网页控件加载和我在LoadingFrameComplete
事件上设置的代码
public Sub webcontrol_addresschanged(sender As Object, e As Awesomium.Core.UrlEventArgs)
//WAIT UNTIL WEB CONTROL LOADS
//DO Something"
End sub
我尝试使用'直到'循环,但它冻结gui和web控件不导航。
答案 0 :(得分:-1)
创建一个模块,将其命名为任何内容(延迟除外)
在模块中复制粘贴这些代码
代码:
Sub Delay(ByVal dblSecs As Double)
Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
Dim dblWaitTil As Date
Now.AddSeconds(OneSec)
dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
Do Until Now > dblWaitTil
Application.DoEvents() ' Allow windows message to be processed
Loop
End Sub
现在,保存它返回到表单的代码
输入此
public Sub webcontrol_addresschanged(sender As Object, e As Awesomium.Core.UrlEventArgs)
Delay(2) 'Delay(x) means x seconds of delay before executing next command without freezing UI
//DO Something"
End sub