How do I create compound keyboard shortcuts in a Windows Forms application?

前端 未结 5 1363
执念已碎
执念已碎 2020-12-31 07:28

I want to create a component that allows us to have compound keyboard shortcuts associated with an arbitrary command, like the Visual Studio IDE and Microsoft Office do.

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-31 07:59

    In addition to some of the answers, using an ampersand in the caption of a button, or menu item, will cause it to be underlined, and accessible by using Alt + the letter you preceded by the ampersand &.

    In other words, if you have a menu item captioned &File it will display with an underline under the F and the user can trigger the menu by clicking Alt + F.

提交回复
热议问题