7

How do I disable the context menu in the IE WebBrowser control and instead perform custom handling of the right-click event in C#?

3 Answers 3

9

Actually:

WebBrowser browser;
browser.IsWebBrowserContextMenuEnabled = false;

This pretty much tells the WebBrowser that the right-click context menu is not welcome.

5
WebBrowser browser;
browser.Document.ContextMenuShowing += new HtmlElementEventHandler(MyCustomContextMenuMethod);
2
AddHandler Me.WebBrowser1.Document.ContextMenuShowing, AddressOf WebContextMenuShowing

I litterally copied your question and worked my google-fu on it...

This was on the first result page :-P

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.