public void UnregisterHotKeys() { //注销Id号为100的热键设定 HotKeysManager.UnregisterHotKey(Handle, 100); //注销Id号为101的热键设定 HotKeysManager.UnregisterHotKey(Handle, 101); }
private void labelTest_MouseEnter(object sender, EventArgs e) { //注册热键Ctrl+C,Id号为100。。 HotKeysManager.RegisterHotKey(Handle, 100, HotKeysManager.KeyModifiers.Ctrl, Keys.C); //注册热键Ctrl+V,Id号为101。 HotKeysManager.RegisterHotKey(Handle, 101, HotKeysManager.KeyModifiers.Ctrl, Keys.V); }
private void labelTest_MouseLeave(object sender, EventArgs e) { //注销Id号为100的热键设定 HotKeysManager.UnregisterHotKey(Handle, 100); //注销Id号为101的热键设定 HotKeysManager.UnregisterHotKey(Handle, 101); }
public MyLabel() : base() { //注册热键Ctrl+C,Id号为100。。 HotKeysManager.RegisterHotKey(Handle, 100, HotKeysManager.KeyModifiers.Ctrl, Keys.C); //注册热键Ctrl+V,Id号为101。 HotKeysManager.RegisterHotKey(Handle, 101, HotKeysManager.KeyModifiers.Ctrl, Keys.V); ////注销Id号为100的热键设定 //HotKeysManager.UnregisterHotKey(Handle, 100); ////注销Id号为101的热键设定 //HotKeysManager.UnregisterHotKey(Handle, 101); }