Search code examples
c#wpfbrowserdesignmode

How to Disable Context menu of the Web Browser control in WPF?


I have a web browser control which show a html local document (EPUB Files) , i would like to turn off right clicks and turn off context menu to unable "Cut" & "Paste" because my web browser is in Design Mode ...


Solution

  • you can disable default context menu by setting IsWebBrowserContextMenuEnabled attribute of WebBrowser to false, then you can create a context menu programmatically and add it to MenuItems List of the WebBrowser. You can find more information here