none
WebBrowser control in VB 2005 RRS feed

  • Question

  • Hi all.  This code snippet from .NET 2003 ( http://support.microsoft.com/default.aspx?scid=kb;en-us;311282 ) handles the opening of a new browser window using a webbrowser control.  This allows me to have the pop-up window of a URL from my "form1" web page to open my "form2" web page, rather than in an independent instance of Internet Explorer.

    Private Sub AxWebBrowser1_NewWindow2(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_NewWindow2Event) Handles AxWebBrowser1.NewWindow2
            Dim frmWB As Form1
            frmWB = New Form1()

            frmWB.AxWebBrowser1.RegisterAsBrowser = True
            e.ppDisp = frmWB.AxWebBrowser1.Application
            frmWB.Visible = True
    End Sub

    .NET 2005 does not have the 'RegisterAsBrowser' or ppdisp properties and the parameters for the 'NewWindow' event are different.  I am basically at a loss on how to do this.

    Can someone help me code this for 2005?

    Thanks,
    Richard
    Thursday, July 28, 2005 6:45 PM

Answers

All replies

  • I had the same problem. I found this (for which I am very greatful).
    http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=7228

    Hope that helps,
    Xaero
    Friday, July 29, 2005 7:08 AM
  • Xaero,

    Thank you so much!  Based on my testing this morning, this will work for me.

    I thought I had done an exhaustive search of everything having to do with "WebBrowser" but I obviously missed this.

    Thanks again.

    Richard
    Friday, July 29, 2005 1:26 PM
  • I tried this, but I'm seeing that the pDisp is coming up as 'Nothing', when the NewWindow3 event gets triggered. All other event parameters seem to come up fine.

    I'm trying to get a reference to the new window but am not being successful.

    Any help is appreciated.

    Thanks,JGP
    Friday, August 19, 2005 7:18 PM