Results 1 to 3 of 3

Thread: VB6 WebBrowser Object and the Open In New Window Issue [Cracked It Anyway]

  1. #1

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Resolved VB6 WebBrowser Object and the Open In New Window Issue [Cracked It Anyway]

    I have a custom web browser that is nothing special jsut the browser object and a few basic controls (stop, refresh, back etc). It is used as part of a bigger project and works very well for my needs in all respect but one.

    Some links open in a new window and IE6 is used... that kinda sucks as it undoes the whole reason for using my program.

    How can I best deal with these links?

    Ideally I'd like to find a way to open them in a new form within my project. I use a MDI and the "browser" is an MDI Child.

    I've Googled on the subject but so far without success.
    Last edited by Matt_T_hat; Sep 19th, 2005 at 11:00 AM. Reason: RESOLVED
    ?
    'What's this bit for anyway?
    For Jono

  2. #2

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Exclamation Re: VB6 WebBrowser Object and the Open In New Window Issue

    I've found this http://msdn.microsoft.com/workshop/b...newwindow2.asp which seems to refer to NewWindow2 but how do I use it?

    ?
    'What's this bit for anyway?
    For Jono

  3. #3

    Thread Starter
    Fanatic Member Matt_T_hat's Avatar
    Join Date
    Dec 2001
    Location
    '76 Male Body Evil-Errors: 666
    Posts
    774

    Resolved Solved It Myself!

    VB Code:
    1. Private Sub WebBrowser1_NewWindow2(ppDisp As Object,
    2.                                    Cancel As Boolean)
    3.    Dim frmWB As Form1
    4.    Set frmWB = New Form1
    5.  
    6.    frmWB.WebBrowser1.RegisterAsBrowser = TRUE
    7.  
    8.    Set ppDisp = frmWB.WebBrowser1.Object
    9.    frmWB.Visible = True
    10. End Sub

    http://support.microsoft.com/kb/q184876/

    I guessed (correctly as it turns out) that WebBrowser1 should be replaced with whatever you called your browser object and form1 as whatever your form is called that holds it.
    ?
    'What's this bit for anyway?
    For Jono

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