简体   繁体   English

如何在WPF中禁用Web浏览器控件的上下文菜单?

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

我有一个显示html本地文档(EPUB文件)的Web浏览器控件,我想关闭右键单击并关闭上下文菜单,使其无法“剪切”和“粘贴”,因为我的Web浏览器处于设计模式...

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. 您可以通过将WebBrowser的IsWebBrowserContextMenuEnabled属性设置为false来禁用默认上下文菜单,然后可以以编程方式创建上下文菜单并将其添加到WebBrowser的MenuItems列表中。 You can find more information here 您可以在这里找到更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM