如何防止使用 Visio 绘图控件出现快捷方式?
我正在使用通过 WindowsFormsHost 在 WPF 应用程序中托管的 VisioDrawingControl。 我想要做的是阻止使用快捷方式(例如 CTRL+D、CTRL+Z 等),因为我使用不同类型的形状(Visio Stencils 和 CAD 文件)并且某些快捷方式可以执行操作影响应用程序行为。
我尝试处理 MainWindow 的 keyup/keydown 事件(使用 eventargs.Handled = true),并从 DrawingControl.Window.Application.BuiltInMenus.AccelTables 中删除相应的 AccelItems。
即使我处理 MainWindow 键盘的事件,VisioDrawingControl 也会“捕获”它们并正常运行。 最后,我尝试撤消 EnterScope 和 ExitScope 事件的修改。 但仍然没有结果。
你有一些提示吗?
I'm working with the VisioDrawingControl hosted, via WindowsFormsHost, in a WPF application.
What I want to do is to prevent the use of the shortcuts(such as CTRL+D, CTRL+Z, and so on), because I'm using different kind of shapes (Visio Stencils and CAD files) and some shortcuts do things that affect the application behaviour.
I've tried handling the MainWindow's keyup/keydown events (with eventargs.Handled = true), and deleting the correspondent AccelItems from DrawingControl.Window.Application.BuiltInMenus.AccelTables.
Even if I handle the MainWindow keyboard's events the VisioDrawingControl "captures" them and acts normally.
At last i've tried to undo the modifications from EnterScope and ExitScope events.
But still with no results.
Do you have some hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论