Silverlight 可以挂接到浏览器的“编辑”>“编辑”吗?剪切/复制/粘贴菜单项?
我们有一个包含网格的 Silverlight 应用程序,并且添加了对选择多个单元格、将其内容复制到剪贴板以及粘贴回网格中其他位置的支持。目前,用户通过单击 Silverlight 应用程序内的工具栏按钮或使用标准键盘快捷键(我们通过 KeyDown 事件捕获)来调用复制和粘贴命令。
是否还可以连接到浏览器的本机“编辑”菜单以及浏览器内置的“剪切”、“复制”、“粘贴”等菜单项?例如,用户是否可以下拉 Firefox 按钮(或按 Alt+E 下拉经典的“编辑”菜单),单击 Firefox 菜单中的“复制”项,并将某种“复制”命令中继到我的 Silverlight 中的焦点控件应用程序?对于 IE、Chrome、Opera 等中的等效菜单也是如此。
如果无法做到这一点,我不会感到惊讶,因为即使像 Adobe Reader 这样历史悠久的浏览器插件也有自己的复制/粘贴按钮甚至打印,而不是连接到浏览器的本机菜单。但我从未对浏览器的插件模型进行过编程,所以我不确定什么是可能的。
We have a Silverlight app that contains a grid, and we've added support for selecting multiple cells, copying their contents to the clipboard, and pasting back elsewhere in the grid. Currently the user invokes the Copy and Paste commands by either clicking a toolbar button inside our Silverlight app, or using the standard keyboard shortcuts, which we catch with a KeyDown event.
Is it possible to also hook into the browser's native Edit menu, and the Cut, Copy, Paste, etc. menu items that are built into the browser? For example, can the user drop down the Firefox button (or press Alt+E to drop down the classic Edit menu), click the Copy item in Firefox's menu, and have some sort of Copy command be relayed to the focused control in my Silverlight app? Same thing for the equivalent menus in IE, Chrome, Opera, etc.
I wouldn't be surprised if this can't be done, since even long-established browser plug-ins like Adobe Reader have their own buttons for copy/paste and even print, rather than hooking into the browser's native menus. But I've never programmed to a browser's plug-in model, so I don't know for sure what's possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论