Oct 9th, 2009, 06:15 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Is There A Way To Disable Ctrl-N on a WebBrowser?
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.
Oct 9th, 2009, 08:45 PM
#2
Addicted Member
Re: Is There A Way To Disable Ctrl-N on a WebBrowser?
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?
Attached Files
Last edited by VBNetDude; Oct 9th, 2009 at 08:50 PM .
Oct 10th, 2009, 10:30 AM
#3
Thread Starter
Addicted Member
Re: Is There A Way To Disable Ctrl-N on a WebBrowser?
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.
Oct 10th, 2009, 11:03 AM
#4
Thread Starter
Addicted Member
Re: Is There A Way To Disable Ctrl-N on a WebBrowser?
Got it!
Disabling the WebBrowserShortcutsEnabled property stops any accelerator keys (such as Ctrl-N from being used)!
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