|
-
Jan 17th, 2008, 06:04 AM
#1
Thread Starter
Frenzied Member
Ctrl+N To Open New Browser Window
The File menu in a web browser project has a sub-menu New. New also has a sub-menu Window named mnuNewWindow. Clicking the Window menu, as usual, opens a new instance of the browser. Ctrl+N has been assigned the shortcut key for Window at design time.
Now what I find is if I press Ctrl+N on the keyboard, not only a new browser window opens but at the same time Windows Explorer's C:\ drive opens up as well (maybe because that is where WinXP is installed).
If I change the shortcut key of Window to, say, Ctrl+Q & press Ctrl+Q on the keyboard, then only a new browser window opens up. I also tried other shortcut combinations & all of them open only a new browser window (& not C:\ along with the new browser window). The problem is only with Ctrl+N. This is how I tried it:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (Shift = 2 And KeyCode = 78) Then
Call mnuNewWindow_Click
End If
End Sub
Private Sub mnuNewWindow_Click()
Dim frmNewWindow As frmWebBrowser
Set frmNewWindow = New frmWebBrowser
frmNewWindow.Show
frmNewWindow.wWeb.Navigate2 "http://www.SomeURL.com"
End Sub
What's causing this problem? How do I ensure that pressing Ctrl+N only opens a new browser window?
Note that I have set the KeyPreview property of the Form which houses the WebBrowser control to True.
Of course, I can assign any other shortcut to Window but since Ctrl+N has been the universally accepted key combination to open a new instance of an app, I did like to adhere to Ctrl+N to open a new browser window.
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|