Windows Develop Bookmark and Share   
 index > Windows Forms General > WebBrowser DocumentCompleted event fires more then one time
 

WebBrowser DocumentCompleted event fires more then one time

The WebBrowser1 DocumentCompleted event is being called four or five times. Should that only be called one time?
This is the Code that I have, let me know if you have any idea?

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim networkAvail As Boolean = testConn()
AddHandler WebBrowser1.DocumentCompleted, AddressOf WebBrowser1_DocumentCompleted
If networkAvail = True Then
sw.Start()
WebBrowser1.Navigate("http://www.cnn.com/")
Else
MsgBox("You have no internet connection")
End If
End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show(WebBrowser1.DocumentText)
End Sub


VbTommy  Monday, September 14, 2009 1:23 AM
paras kumar  Monday, September 14, 2009 3:04 AM
Normal. Compare the uri to the requested uri.
JohnWein  Monday, September 14, 2009 2:54 AM
paras kumar  Monday, September 14, 2009 3:04 AM
A side effect of the web page containing frames. You'll get the event for each frame.

Hans Passant.
nobugz  Monday, September 14, 2009 12:39 PM

You can use google to search for other answers

Custom Search

More Threads

• Disabling child window titlebar using User32.dll C#
• Preventing a form from showing
• use single usercontrol in different folder
• Closing a Form Automatically in an Activate Event
• Password change logic.
• How to perform cut,delete ,zoom operation in bitmap ?
• Custom Control not updating
• Trigger a javasctipt function in a WebBrowser control?
• problems modifying access db data...
• How to programmatically scroll a treeview control?