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");
     }
 }
Exemplo n.º 2
0
 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;
             }
         }
     }
 }
Exemplo n.º 3
0
 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();
             }
         }
     }
 }
 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();
             }
         }
     }
 }
 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;
             }
         }
     }
 }