Hi, is there any way to disable Ctrl-N on a WebBrowser control using VB or JavaScript? I couldn't find any straight or working answers on Google so I thought maybe we could finally get a straight answer for the next person thinking the same thing.
Printable View
Hi, is there any way to disable Ctrl-N on a WebBrowser control using VB or JavaScript? I couldn't find any straight or working answers on Google so I thought maybe we could finally get a straight answer for the next person thinking the same thing.
You might try writing a global keyboard hook and disabling the keystrokes as they come...
Here is a sample global hook you might take a look at. I didn't make this, but found it off the internet because I wanted a global hook.
I suppose you would have to also check the current process for IE or FireFox, etc...
What type of control? And What are you trying to do? Not allow anybody to open a new tab?
I think that's a little overkill for just disabling Ctrl-n!
I'm trying to stop users from opening a new window in a WebBrowser.
Got it!
Disabling the WebBrowserShortcutsEnabled property stops any accelerator keys (such as Ctrl-N from being used)!