HotKeyManegerRegHotKey(HotKeyManegerCHotKeyDelegateHotKey, String, Keys, Boolean, Boolean, Boolean, Object) 方法
注册快捷键
命名空间: Excel880VSTO程序集: Excel880VSTO (在 Excel880VSTO.dll 中) 版本:1.5.8.0 (1.5.8.0)
public static HotKeyManegerCHotKey RegHotKey(
DelegateHotKey Callback,
string Name,
Keys Key,
bool bCtrl = false,
bool bShift = false,
bool bAlt = false,
Object tag = null
)
Public Shared Function RegHotKey (
Callback As DelegateHotKey,
Name As String,
Key As Keys,
Optional bCtrl As Boolean = false,
Optional bShift As Boolean = false,
Optional bAlt As Boolean = false,
Optional tag As Object = Nothing
) As HotKeyManegerCHotKey
Dim Callback As DelegateHotKey
Dim Name As String
Dim Key As Keys
Dim bCtrl As Boolean
Dim bShift As Boolean
Dim bAlt As Boolean
Dim tag As Object
Dim returnValue As HotKeyManegerCHotKey
returnValue = HotKeyManeger.RegHotKey(Callback,
Name, Key, bCtrl, bShift, bAlt, tag)
- Callback DelegateHotKey
- 指定一个触发的事件,可以独立也可以共用
- Name String
- 热键的功能描述 要全局唯一
- Key Keys
- Ctrl+Shift+Enter以外的单个按键
- bCtrl Boolean (Optional)
- 是否启用Ctrl
- bShift Boolean (Optional)
- 是否启用Shift
- bAlt Boolean (Optional)
- 是否启用Alt
- tag Object (Optional)
- 热键对象关联的目标 一般传入一个控件
HotKeyManegerCHotKey