Results 1 to 7 of 7

Thread: WebBrowser Control/Internet Explorer

  1. #1

    Thread Starter
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    there is an even for the web browser control that gets called whenever a new window gets open... what you can do is have it load the page in a new instance of form1... though i don't have access to vb on this machine so i can't give u code
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  2. #2
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Yep, I'm using the code;

    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Dim F As Form
    Set F = frmBrowser
    F.Show
    End Sub

    Is there anything wrong with that??
    I have the same code in my Menu, for opening a New Window, but as I said above, in the WebBrowser its opening in IE
    Don't Rate my posts.

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Pc_Madness
    Yep, I'm using the code;

    Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    Dim F As Form
    Set F = frmBrowser
    F.Show
    End Sub
    You've almost got it...
    VB Code:
    1. Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    2. Dim F As new frmBrowser
    3.         set ppDisp = F.WebBrowser1
    4.         F.Show
    5. End Sub

    Try that.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  4. #4
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Yep it works. Thanks a million

    Now other question I have is

    The other one is, I've set the shortcut "New Window" in my Menu to Ctrl+N (the same as IE's...) when people use it, it opens another window in IE
    Whats causing this??
    Don't Rate my posts.

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Just navigate to the same location with a blank target like this...
    VB Code:
    1. Private Sub mnuFileNew_Click()
    2.   WebBrowser1.Navigate WebBrowser1.Document.location.href, , "_blank"
    3. End Sub

    It should fire the NewWindow2 event which will open a new instance of your browser.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Nope it didn't work.

    Ok so, when I click on New Window (FileNewWin) , it will open it normally, which is great, but I've given it the shortcut Ctrl + N, the same as Internet Explorer's so that people can have a similar feel. But instead it opens in IE window.

    I just tried changing the Shortcut to Ctrl + o which doesn't work, but CTRL + U does.
    Don't Rate my posts.

  7. #7
    PowerPoster Pc_Madness's Avatar
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    2,765
    Just trying to get this back at the top of the forums.......
    Don't Rate my posts.

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