I want to disable the context menu in my WPF System.Windows.Controls.WebBrowser. How would I do so?
Asked
Active
Viewed 3,049 times
0
-
1The WPF version doesn't support suppressing the menu. You can use the Winforms version of WebBrowser, display it in a WindowsFormsHost. Set its IsWebBrowserContextMenuEnabled property to false. – Hans Passant Oct 14 '12 at 17:34
4 Answers
4
Adding an oncontextmenu attribute to the document body tag.
<body oncontextmenu="return false;">
2
Just use
// Disable the Context menu inside the web browser
webBrowser1.IsWebBrowserContextMenuEnabled = false;
i tried this in Windows Applications

BOSS
- 1,828
- 11
- 34
- 60
-
1This answer only applies to `System.Windows.Forms.WebBrowser`, not `System.Windows.Controls.WebBrowser` which is what is requested in the question. – Jan Oct 08 '14 at 09:09
0
WPF WebBrowser Control has many Touch events that you could capture and handle and potentially stop the ContextMenu from ever popping up. Or you could supply your own ContextMenu for the browser to use.
The preview events are lower down on the page and can be used to intercept events that would cause the context menu to pop-up.

Furqan Safdar
- 16,260
- 13
- 59
- 93