简体   繁体   中英

Winform shortcut key sub menu item

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. Eg 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM