void hotKeyControl1_HotKeyIsSet(object sender, HotKeyIsSetEventArgs e) { if (MainForm.MyHotKeyManager.HotKeyExists(e.Shortcut, HotKeyManager.CheckKey.LocalHotKey)) { e.Cancel = true; MessageBox.Show("This HotKey has already been registered"); } }
private void TextBox_KeyUp(object sender, KeyEventArgs e) { //On KeyUp if KeyisSet is False then clear the textbox. if (KeyisSet == false) { this.Text = String.Empty; } else { if (HotKeyIsSet != null) { var ex = new HotKeyIsSetEventArgs(UserKey, UserModifier); HotKeyIsSet(this, ex); if (ex.Cancel) { KeyisSet = false; this.Text = String.Empty; } } } }
void HotKeyControl_KeyUp(object sender, KeyEventArgs e) { //On KeyUp if KeyisSet is False then clear the textbox. if (KeyisSet == false) { this.Text = Keys.None.ToString(); } else { if (HotKeyIsSet != null) { var ex = new HotKeyIsSetEventArgs(UserKey, UserModifier); HotKeyIsSet(this, ex); if (ex.Cancel) { KeyisSet = false; this.Text = Keys.None.ToString(); } } } }