Results 1 to 2 of 2

Thread: Webbrowser RegisterAsBrowser in Modal Appliction

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2010
    Posts
    6

    Webbrowser RegisterAsBrowser in Modal Appliction

    Hi ppl,

    I have a modal application where I have a form with a webbrowser control on it. When the user select a link which opens a new window I am trying to handle the event to open a new form with an other webbrowser control to show the select link in this new window. I am trying to achieve this by doing


    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Dim ie As frmIvan
    Set ie = New frmIvan
    ie.WebBrowser1.RegisterAsBrowser = True
    Set ppDisp = ie.WebBrowser1.object
    ie.Show vbModal
    Set ie = Nothing
    Cancel = True
    End Sub

    The form frmIvan opens with the browser on it but it does not navigate on the selected page. Any one gas any idea what might be wrong

    Thanks
    Ivan

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Webbrowser RegisterAsBrowser in Modal Appliction

    This line of code:
    Code:
    Set ppDisp = ie.WebBrowser1.object
    ..takes whatever is in ie.WebBrowser1.object and puts it in ppDisp

    Shouldn't that be the other way around?

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