DownloadComplete

  • Thread starter Thread starter GS
  • Start date Start date
G

GS

is there such thing as DownloadComplete for AxSHDocVw.AxWebBrowser?

and if there is, what is the name for the event object?
 
GS,
is there such thing as DownloadComplete for AxSHDocVw.AxWebBrowser?
You seems to be for me a funny guy.
I have given you the link to that yesterday.

Cor
 
GS said:
is there such thing as DownloadComplete for AxSHDocVw.AxWebBrowser?

Select the control in VS' text editor's left combobox and choose the event
from the combobox on the right top edge of the text editor.
 
not quite as smart programmatically as in younger days? maybe. However I did
see the link but could not get vb express to show anything close to
downloadcomplete

after some further research, I end up doing
Public Event DownloadComplete(ByVal sender As Object, ByVal e As EventArgs)


Private Sub webBrowser_DownloadComplete(ByVal sender As Object, ByVal e As
EventArgs) Handles webBrowser.DownloadComplete
RaiseEvent DownloadComplete(sender, e)

End Sub


However, I found out that does not work the way I want. Donwload Complete
fires mnaytimes, while the so call navigatecomplete fires when the browser
may still be trying to render page. consequently that is not good enough
for my task.
 
GS said:
However, I found out that does not work the way I want. Donwload Complete
fires mnaytimes, while the so call navigatecomplete fires when the browser
may still be trying to render page. consequently that is not good enough
for my task.

What about this solution?

\\\
Private Sub WebBrowser1_DocumentCompleted( _
ByVal sender As Object, _
ByVal e As WebBrowserDocumentCompletedEventArgs _
) Handles WebBrowser1.DocumentCompleted
If Me.WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
MsgBox("Document and frames loaded!")
End If
End Sub
///
 
thank you for setting me on the right track.


Since I don't work directly with webbrowser control but the encapsulated
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent as webOCWrapper
I had your idea added there.
Private Sub webBrowser_DocumentComplete(ByVal sender As Object, ByVal e
As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles
webBrowser.DocumentComplete
Try
doc = CType(webBrowser.Document, MSHTML.HTMLDocument)
Catch
' Not a fatal error - we might be hosting a Word doc in-place,
' e.g.
End Try

' Bubble up to our host.
If Me.webBrowser.ReadyState = WebBrowserReadyState.Complete Then
'MsgBox("Document and frames loaded!")
RaiseEvent TopLevelDocumentComplete(sender, e)
End If

End Sub

and TopLevelDocumentComplete was declared there as
TopLevelDocumentComplete

Those accomplish what I need. thank you all again for all your patience.
 
Back
Top