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
Printable View
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
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
You've almost got it...Quote:
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
VB Code:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) Dim F As new frmBrowser set ppDisp = F.WebBrowser1 F.Show End Sub
Try that.
:)
Yep it works. Thanks a million :)
Now other question I have is
Whats causing this??Quote:
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
Just navigate to the same location with a blank target like this...
VB Code:
Private Sub mnuFileNew_Click() WebBrowser1.Navigate WebBrowser1.Document.location.href, , "_blank" End Sub
It should fire the NewWindow2 event which will open a new instance of your browser.
:)
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.
Just trying to get this back at the top of the forums.......