如何防止使用 Visio 绘图控件出现快捷方式?

发布于 2024-12-28 12:49:44 字数 448 浏览 3 评论 0原文

我正在使用通过 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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文