如我现在打开
Private Sub Command2_Click()WebBrowser1.Navigate "http://www.baidu.com/"?
a=3+2
mogbox a
End Sub
如果某个网页有很多图片,加载完成要很慢,判断整个网页是否加载完成,才弹出mogbox,该怎么写,现在是不管加载完成没完成他都直接弹出
Private Sub Command2_Click()WebBrowser1.Navigate "http://www.baidu.com/"?
a=3+2
mogbox a
End Sub
如果某个网页有很多图片,加载完成要很慢,判断整个网页是否加载完成,才弹出mogbox,该怎么写,现在是不管加载完成没完成他都直接弹出
DoEvents
Wend
WebBrowser1_DownloadComplete()
If (pDisp Is WebBrowser1.Object) Then
a=3+2
mogbox a
End If End Sub
DoEvents
If WebBrowser1.Busy = True Then
Else Dim htmhref As New HTMLAnchorElement
Dim htmldoc As New HTMLDocument
Dim htmlEle As New HTMLDTElement
Dim htmlEles As IHTMLElementCollection
Dim nlen As Long
Set htmldoc = WebBrowser1.Document
Set htmlEles = htmldoc.All
nlen = htmlEles.length
Dim i As Long
Dim j As Long
j = 0
For i = 0 To nlen - 1
Set htmlEle = htmlEles.Item(i)
If (htmlEle.tagName = "A") Then
Set htmhref = htmlEle
aaa = "http://map.baidu.com"
If InStr(1, htmhref.href, aaa) <> 0 Then
Ret = SendMessageFind(List1.hwnd, LB_FINDSTRING, 0, (htmhref.href))
If Ret = LB_ERR Then
List1.AddItem htmhref.href
If List1.ListCount >= 1000 Then Exit Do
Me.Caption = List1.ListCount
End If
End If
End If
Next i
End If
Loop
If WebBrowser1.LocationURL = "http://www.qq.com" Then
If pDisp Is WebBrowser1.Object Then MsgBox "页面加载完成"
End If
End Sub