0

Microsoft in a KnowledgeBase article suggests that I should have the following code in place to properly detect DocumentCompleted (this is VB code that I guess is trying to talk to the COM object):

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
   If (pDisp Is WebBrowser1.Object) Then
      Debug.Print "Web document is finished downloading"
   End If
End Sub

pDisp points to the frame object (or the document object if there are no frames in the page) that raised DocumentCompleted event. Now my question is how can I do the same thing for a WinForms WebBrowser control? The DocumentCompleted here has an object sender parameter, but that always points to the WebBrowser control itself, not the child frames.

Dmitry
  • 13,797
  • 6
  • 32
  • 48
dotNET
  • 33,414
  • 24
  • 162
  • 251
  • 1
    possible duplicate of [WebBrowser DocumentCompleted event fired more than once](http://stackoverflow.com/questions/3239204/webbrowser-documentcompleted-event-fired-more-than-once) – Hans Passant Apr 05 '14 at 10:08
  • I handle this by observing `onload`: http://stackoverflow.com/a/18370524/1768303 – noseratio Apr 05 '14 at 13:05

0 Answers0