Disable context menu in Internet Explorer control

泪湿孤枕 提交于 2019-12-10 04:17:26

问题


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


回答1:


Actually:

WebBrowser browser;
browser.IsWebBrowserContextMenuEnabled = false;

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




回答2:


WebBrowser browser;
browser.Document.ContextMenuShowing += new HtmlElementEventHandler(MyCustomContextMenuMethod);



回答3:


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



来源:https://stackoverflow.com/questions/656350/disable-context-menu-in-internet-explorer-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!