Results 1 to 4 of 4

Thread: [RESOLVED] Is There A Way To Disable Ctrl-N on a WebBrowser?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    Resolved [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.

  2. #2
    Addicted Member
    Join Date
    Oct 2009
    Location
    Clive, IA in America!!!!
    Posts
    204

    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 Attached Files
    Last edited by VBNetDude; Oct 9th, 2009 at 08:50 PM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    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.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    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
  •  



Click Here to Expand Forum to Full Width