创建快捷键 [英] Creating shortcuts key

查看:125
本文介绍了创建快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在gui应用程序中创建剪切,复制,粘贴,保存,另存为,粗体等快捷键?

How can we create shortcut key in gui application like cut,copy,paste,save,save as, bold etc?

推荐答案

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

对于其他情况,可以使用&在大多数框架中实现它们.菜单中的符号,通过分配手势或命令绑定的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.


这篇关于创建快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆