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.