Winform快捷键子菜单项

发布于 2024-11-28 07:37:56 字数 296 浏览 7 评论 0原文

我正在尝试为 WinForm 中的上下文菜单上的子菜单项创建快捷键,但它不起作用/事件不会被触发。 例如上下文菜单。

查找

-----按单词 (Alt + W)

-----按名称 (Alt + N)

剪切 (Alt + C)

复制 (Alt + X)

粘贴 (Alt + P)

剪切、复制的快捷键、和粘贴可以工作,但“按字词”和“按名称”的快捷键不起作用。 快捷键是使用控件属性连接的,并且没有任何快捷键在其他地方使用。

还有其他人有同样的问题吗?

I'm trying to create shortcut keys for a sub menu item on a context menu in WinForm but it doesnt work/ event does not get fired.
E.g context menu.

Find

-----By Word (Alt + W)

-----By Name (Alt + N)

Cut (Alt + C)

Copy (Alt + X)

Paste (Alt + P)

The shortcut keys for Cut, Copy, and Paste work but shortcut keys for By Word and By Name does not work.
The shortcut keys are hooked up using the control properties, and none of the shortcuts are used anywhere else.

Is anyone else having the same problem?

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

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

发布评论

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

评论(1

海夕 2024-12-05 07:37:56

从理论上讲,如果您的主栏菜单项以 W 或 N 开头,则可能会发生这种情况。Alt + 键组合通常会将焦点放在菜单上。

如果不是这种情况,则您的系统上可能有一个应用程序在该组合上设置了挂钩(例如多桌面管理器...)。

就像证明这个理论一样,尝试改变所需的按键组合,看看它是否有效。

问候。

This theorically could happen if you have mainbar menu items which begin with W or N. Alt+Key combination gives a focus on menu usually.

If this is not a case, there could be an application on your system that setupped hook on that combinations ( for example multidesktop manager...).

Like a prove to this theory, try to change desired keys combination and see if it works.

Regards.

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