Results 1 to 2 of 2

Thread: WebBrowser Control

  1. #1
    Guest

    Angry

    How do I set my WebBrowser control to open target=_blank URL's in a new window? It opens IE!! I'm createing this browser to get AWAY from IE! (I know the WebBrowser control is IE's window, but I can improve it a little anyway.)

    My book tells me that the WebBrowser_NewWindow event would do the trick, but is no NewWindow event when I look into the code window. When I type it in manually, it puts the even into then General catagory and doesn't work.

    There is, however, a WebBrowser_NewWindow2 event. This event's paramiters are ppDisp As Object, Cancel As Boolean. I don't know what ppDisp does, but if you set Cancel to True, IE doesn't pop up! I thought I could use this even to stop IE and create my own popup window to display the URL, but how do I get the url? It is not passed into the parameters so I've got no idea.

    Can anyone help me out with this? I found several source codes that offered no solution.

  2. #2
    Guest
    This will open a new url using your program instead of IE.

    Code:
    Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Dim Frm As New Form1
    Set ppDisp = Frm.webbrowser1.Object
    Cancel = False
    Frm.Show
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width