Hi I have created a web browser and am trying to get the link that is clicked that would normally open in a new window to open in the current window as I do not want to open any other windows or tabs. This is the code I have so far and it seems to work well kind of anyway, it opens the last url not the new one. Sometime it will open just an advert, it seems to open what ever link was last loaded on the site. Here is the code:
Code:
Private newURL As String
Private Sub browser_Navigating(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles browser.Navigating
newURL = e.Url.ToString
End Sub
Private Sub Browser_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles browser.NewWindow
'MessageBox.Show(newURL)
browser.Navigate(newURL)
e.Cancel = True
End Sub
I got the code from this thread http://www.vbforums.com/showthread.p...wser+newwindow
Anyone know what I am doing wrong.
Should I not be using the or the ie is there something else I should be using?