如何在WPF中禁用webbrowser中的右键单击上下文菜单? [英] How to disable the right click context menu in webbrowser in WPF?

查看:222
本文介绍了如何在WPF中禁用webbrowser中的右键单击上下文菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在WPF中禁用webbrowser中的右键单击上下文菜单。但不知何故,事件处理程序无法正常工作。

如果有人想要禁用它,那将非常有用。

I am trying to disable the right click context menu inside webbrowser in WPF. But somehow the event handlers are not working.
It would be really helpful if someone has any idea on disabling it.

推荐答案

https://groups.google.com/forum/#!topic/microsoft.public。 vc.mfc / IE91jqoS7P8 [ ^ ]



希望它会有所帮助..
https://groups.google.com/forum/#!topic/microsoft.public.vc.mfc/IE91jqoS7P8[^]

hope it will help..


你好,



感谢您的快速回复。解决方案是使用C ++非托管代码。



实际上我有类似的要求,但它在WPF中网页浏览器。我有一个包含webbrowser控件的xaml文件。我需要禁用右键单击上下文菜单,但无法在互联网上找到任何帮助。如果你们对WPF有任何想法,无论是通过在xaml中设置属性还是在代码后面的ViewModel中实现,都非常感激。
Hello,

Thanks for your quick reply.The solution is in C++ unmanaged code.

Actually I have a similar requirement but its in WPF Webbrowser. I have a xaml file which contains webbrowser control. I need to disable the right click context menu but unable to find any help on the internet. If you guys have any idea on the WPF ,either by setting the property in xaml or the implementation in the ViewModel behind the code, really appreciate it.


如果在网络中使用jQuery页面,以下作品完美



If jQuery is being used in the web page, following works perfect

private void WebBrowser_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
{
            ((WebBrowser)sender).InvokeScript("eval", 
               "


这篇关于如何在WPF中禁用webbrowser中的右键单击上下文菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆