我可以为所有支持 Silverlight 2.0 的浏览器覆盖 Silverlight 中的上下文菜单吗?

发布于 2024-07-20 17:38:42 字数 502 浏览 2 评论 0原文

这似乎是 Google 上的一个常见问题,但我找不到满意的答案(除非答案是“否”)。

我想在用户右键单击我的 Silverlight 应用程序时添加菜单项或显示自定义菜单。

我发现的最接近的东西捕获了 IE 中的上下文菜单,但不是 Firefox 中的上下文菜单,Chrome 显示了上下文菜单,然后显示了自定义事件。

(我提到的教程在这里 http://silverlight.net/blogs/msnow/archive/2008/07/01/tip-of-the-day-14-how-to-right-click-on- a-silverlight-application.aspx)

It seems like a common question on Google, but I couldn't find a satisfactory answer (unless the answer is 'no')

I would like to add menu items or show a custom menu when a user right-clicks on my Silverlight app.

The closest thing that I found catches the context menu in IE, but not in Firefox, and Chrome shows the context menu and then shows the custom event.

(The tutorial I mentioned was here
http://silverlight.net/blogs/msnow/archive/2008/07/01/tip-of-the-day-14-how-to-right-click-on-a-silverlight-application.aspx)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一人独醉 2024-07-27 17:38:42

这里你有一个实现,但它是 CTRL+左键单击,然后你会得到一个上下文菜单(关于文本,抱歉它是西班牙语):

http://www.albloguera.es/?p=29

另一种选择是通过 javascript 指出的,相当笨重的解决方案,不确定现在是否可以在当前 2.0 版本:-(。

祝你好运
布劳略

Here you have an implementation but it's CTRL+Left click, then you get a context menu (about the text, sorry it's in spanish):

http://www.albloguera.es/?p=29

Another option, is the one pointed out do it via javascript, quite chunky solution, and not sure if now it's working in the current 2.0 version :-(.

Good Luck
Braulio

本王不退位尔等都是臣 2024-07-27 17:38:42

Silverlight 中没有办法以本机方式执行此操作。

我相信其他地方提到的 Telerik 控件使用 HtmlBridge 来拦截上下文单击,然后绘制自己的菜单,但是它现在似乎无法与 Silverlight 2.0.40115 一起使用,所以也许 Microsoft 已经弥补了这一差距。

没有右键单击是基于安全考虑的设计决策,而不是技术决策。 不过我相信微软团队正在考虑在未来版本(甚至可能是 v3)中允许上下文菜单

There is no way to do this natively in Silverlight.

I believe that the Telerik control noted elsewhere uses the HtmlBridge to intercept the context click, then draw their own menu, however it does not appear to be working with Silverlight 2.0.40115 now, so maybe Microsoft have closed that gap.

Having no right click is a design decision based on security concerns, rather than a technical one. However I believe that the Microsoft team are considering allowing context menu's in future versions (perhaps even v3)

可可 2024-07-27 17:38:42

根据我对 Telerik 上下文菜单的使用,我得出的结论是,它似乎可以在 IE、Chrome 和 Firefox 上正常工作。

看看,http://demos.telerik.com/silverlight/#ContextMenu/FirstLook< /a>

I've come to the conclusion that it seems it is possible based on my use of Telerik's context menu which works fine on IE, Chrome and Firefox.

Check it out, http://demos.telerik.com/silverlight/#ContextMenu/FirstLook

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文