Setting the Windows Forms ToolStripMenuItem ShortcutKeys property to numpad key does not work

后端 未结 2 1707
后悔当初
后悔当初 2021-01-13 16:56

We have the ability to define shortcut keys for Windows Forms application menu items. That way I can tell a menu item File->Save to have the shortcut key Ctrl<

2条回答
  •  情歌与酒
    2021-01-13 17:24

    You must use Ctrl or Alt in shortcuts.

    example:

    //working:  
    toolStripMenuItem1.ShortcutKeys = Keys.Control | Keys.NumPad0;  
    //throws exception  
    toolStripMenuItem1.ShortcutKeys = Keys.NumPad0;  
    

提交回复
热议问题