WebBrowser Control Events

  • Thread starter Thread starter Anil Gupe/keen inc.
  • Start date Start date
A

Anil Gupe/keen inc.

I used the following to create a new Web Browser Control
Dim WithEvents webBrowserContent As New AxSHDocVw.AxWebBrowser

It works fine for some things for example
webBrowserContent.Navigate(url) works. However, the DocumentComplete,
NavigateComplete2 and a couple of other events I tried do not trigger when
the user navigates in that WebBrowser Control - what am I doing wrong?

Thanx,
 
I used the following to create a new Web Browser Control
Dim WithEvents webBrowserContent As New AxSHDocVw.AxWebBrowser

It works fine for some things for example
webBrowserContent.Navigate(url) works. However, the DocumentComplete,
NavigateComplete2 and a couple of other events I tried do not trigger when
the user navigates in that WebBrowser Control - what am I doing wrong?

Thanx,

Anil,
You can use Webbrowser control, wrapped version of ShDocVw and
available in your toolbox. After placing it on your form, double-click
on it and the such events can be created like this:

' Document completed event
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles
WebBrowser1.DocumentCompleted
' Code here
End Sub

'Navigated event
Private Sub WebBrowser1_Navigated(ByVal sender As System.Object, ByVal
e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles
WebBrowser1.Navigated
' Code here
End Sub

and you can find more by seeing events after "handles" clause.

Hope this helps,

Onur Güzel
 
Thanx, but I am already doing that, except that I am not inserting the
WebBrowser control, but I am creating it dynamically. The event handlers
exist in my document. In fact, as far as I could tell, these were working
while I was in VS 2003 environment, but not in VS 2005 which I am using now.

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
www.wizo.tv
I used the following to create a new Web Browser Control
Dim WithEvents webBrowserContent As New AxSHDocVw.AxWebBrowser

It works fine for some things for example
webBrowserContent.Navigate(url) works. However, the DocumentComplete,
NavigateComplete2 and a couple of other events I tried do not trigger when
the user navigates in that WebBrowser Control - what am I doing wrong?

Thanx,

Anil,
You can use Webbrowser control, wrapped version of ShDocVw and
available in your toolbox. After placing it on your form, double-click
on it and the such events can be created like this:

' Document completed event
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles
WebBrowser1.DocumentCompleted
' Code here
End Sub

'Navigated event
Private Sub WebBrowser1_Navigated(ByVal sender As System.Object, ByVal
e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles
WebBrowser1.Navigated
' Code here
End Sub

and you can find more by seeing events after "handles" clause.

Hope this helps,

Onur Güzel
 
Back
Top