Hi Guys,

I am currently making a web browser, and it is all working except when i open links which are to open in a new window, they open in IE. I have got the code below which "should" force the link to open in my existing browser, but it just opens a blank page.


 Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow

        Dim myElement As HtmlElement = WebBrowser1.Document.ActiveElement
        Dim target As String = myElement.GetAttribute("href")

        Dim newInstance As New Form1

        e.Cancel = True
    End Sub

Any ideas/solutions?



I copied your code as is and it works fine for me. I am assuming that you are right clicking on a link and selecting "Open in New Window" from the context menu. For me, this opens a new instance of Form1 with the page loading for the selected link.