且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

创建快捷键

更新时间:2023-02-03 11:37:12

剪切,复制和粘贴为通常为您处理基本类型.

对于其他情况,可以使用&在大多数框架中实现它们.菜单中的符号,通过分配手势或命令绑定的WPF中的符号,或在任何.NET应用程序中通过创建从IMessageFilter派生的类并对它做一些有趣的事情.

IMessageFilter [快捷方式管理器 [
Cut, copy and paste are typically handled for you for basic types.

For the others, they can be implemented in most frameworks with the & notation in menus, in WPF by assigning a gesture or command binding, or in any .NET app by creating a class that derives from IMessageFilter and doing something interesting to it.

IMessageFilter[^]

Or, you can use someone else''s code: Shortcut Manager[^]

Cheers.


请参见此处 [
创建一个ToolStripMenuItem完成任务并为其分配一个Shortcut.如果您不希望在Form上放置MenuStrip,请改为将其放在ToolStripContextMenu中.
Create a ToolStripMenuItem to do the job and assign a Shortcut to it. If you don''t want a MenuStrip on your Form, put it in a ToolStripContextMenu instead.