Home All Groups Group Topic Archive Search About

WebBrowser control in vb

Author
8 Dec 2006 2:38 PM
AMercer
Using .net 2003, fw 1.1, and vb, I'm trying to use the MS Web Browser control
(which added a ref to AxSHDocVw).  I tried this a few years ago, and couldn't
figure out how to tell if a navigation had completed.  I still can't figure
it out.  The general nature of the problem is that a Navigate2 results in
multiple events firing including multiple varieties of Complete events, and I
can see no way to be certain which one really means it.

1.  How do you tell when the navigate2 document is really finished?
2.  Is there a better way than the Web Browser control?
3.  In an MS document about this topic, they showed the code below.  How do
you do this in .net?

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

The above appeared in an MS Help document titled "How To Determine When a
Page Is Done Loading in WebBrowser Control"

Author
8 Dec 2006 5:53 PM
Cor Ligthert [MVP]
Amercer

Have a look in that one to the download completed, the navigate completed
tells only that you have requested all (be aware that much classic webpages
exist from 4 frames).

Cor

Show quoteHide quote
"AMercer" <AMer***@discussions.microsoft.com> schreef in bericht
news:DCD5F4C2-7AC2-47B8-AA37-CA2FDF51D1A8@microsoft.com...
> Using .net 2003, fw 1.1, and vb, I'm trying to use the MS Web Browser
> control
> (which added a ref to AxSHDocVw).  I tried this a few years ago, and
> couldn't
> figure out how to tell if a navigation had completed.  I still can't
> figure
> it out.  The general nature of the problem is that a Navigate2 results in
> multiple events firing including multiple varieties of Complete events,
> and I
> can see no way to be certain which one really means it.
>
> 1.  How do you tell when the navigate2 document is really finished?
> 2.  Is there a better way than the Web Browser control?
> 3.  In an MS document about this topic, they showed the code below.  How
> do
> you do this in .net?
>
> 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
>
> The above appeared in an MS Help document titled "How To Determine When a
> Page Is Done Loading in WebBrowser Control"
>