Results 1 to 7 of 7

Thread: [2005] Disable Right click

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    4

    [2005] Disable Right click

    I am using a web browser control in visual basic .NET 2005 and i want to stop people from right click when browsing WebPages. This can either disable right click for the whole form or just the web browser it doesn't really matter. Could someone tell me the code to do this.

    Thanks
    Last edited by ezhost; Mar 31st, 2006 at 07:57 PM.

  2. #2
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Post Re: [2005] Diable Right click

    I've only seen this done via code in the HTML page.

    I'm not sure if it can be done in the control or not.
    ~Peter


  3. #3
    Hyperactive Member francisstokes's Avatar
    Join Date
    May 2005
    Location
    Kent, England
    Posts
    272

    Re: [2005] Diable Right click

    im not sure, and this isnt the code, but wouldnt it be something similar to:
    VB Code:
    1. Private Sub WebBrowser1_RightClick() Handles WebBrowser1.mousedown.right
    2. messagebox.show("Disabled", "Error")
    3. end sub

    Dont take that literally because i dont know, but i think its something along those lines.

  4. #4
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Re: [2005] Diable Right click

    I don't see any "RightClick" events for the WebBrowser control.
    ~Peter


  5. #5
    Hyperactive Member francisstokes's Avatar
    Join Date
    May 2005
    Location
    Kent, England
    Posts
    272

    Re: [2005] Diable Right click

    ....
    Quote Originally Posted by francisstokes
    im not sure, and this isnt the code, but wouldnt it be something similar to:


    Dont take that literally because i dont know
    , but i think its something along those lines.

  6. #6
    Hyperactive Member francisstokes's Avatar
    Join Date
    May 2005
    Location
    Kent, England
    Posts
    272

    Re: [2005] Diable Right click

    I did a search on the forums and found this:

    http://vbforums.com/showthread.php?t...ight=mousedown

  7. #7
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: [2005] Diable Right click

    I think you have to subclass the window


    Or if you just want to disable the context menu
    VB Code:
    1. WebBrowser1.IsWebBrowserContextMenuEnabled = False

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