SHARE
TWEET

Untitled

a guest Jun 20th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (e.Key == Key.Return && (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl))
  2.  {
  3.    //Do Something            
  4.  }
  5.      
  6. void SpecialKeyHandler(object sender, KeyEventArgs e)
  7. {
  8.     // Ctrl + N
  9.     if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.N))
  10.     {
  11.         MessageBox.Show("New");
  12.     }
  13.  
  14.     // Ctrl + O
  15.     if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.O))
  16.     {
  17.         MessageBox.Show("Open");
  18.     }
  19.  
  20.     // Ctrl + S
  21.     if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.S))
  22.     {
  23.         MessageBox.Show("Save");
  24.     }
  25.  
  26.     // Ctrl + Alt + I
  27.     if ((Keyboard.Modifiers == (ModifierKeys.Alt | ModifierKeys.Control)) && (e.Key == Key.I))
  28.     {
  29.         MessageBox.Show("Ctrl + Alt + I");
  30.     }
  31. }
  32.      
  33. if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Enter)
  34.      
  35. if (e.KeyChar == 10)
  36.             {
  37.              ///Code
  38.             }
  39.      
  40. if ((Char)e.KeyChar == 'n')
  41.             {
  42.              ///Code
  43.             }
  44.      
  45. if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.Enter))
  46.         {            
  47.             Button_Click_Save(sender, e);
  48.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top