Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Menu controls have property named <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.menuitem.shortcut.aspx" rel="nofollow noreferrer">ShortCut</a> where you can assign a value. When you press that shortcut key, that menu item will be invoked. Use that property for the commands that has a corresponding menu.</p> <p>If you need shortcuts that won't be available on the menus, then you'll have to handle that your self via the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keyup.aspx" rel="nofollow noreferrer">KeyUp</a> or <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keydown.aspx" rel="nofollow noreferrer">KeyDown</a> events, either on the form or the control. A <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.keyeventargs.aspx" rel="nofollow noreferrer">KeyEventArgs</a> object will be passed to your handler, and you can check which key is pressed, and whether the Ctrl, Alt or Shift keys were also pressed.</p> <p>Sample code from MSDN:</p> <pre><code>// Handle the KeyDown event to determine the type of character entered into the control. private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { // Initialize the flag to false. nonNumberEntered = false; // Determine whether the keystroke is a number from the top of the keyboard. if (e.KeyCode &lt; Keys.D0 || e.KeyCode &gt; Keys.D9) { // Determine whether the keystroke is a number from the keypad. if (e.KeyCode &lt; Keys.NumPad0 || e.KeyCode &gt; Keys.NumPad9) { // Determine whether the keystroke is a backspace. if(e.KeyCode != Keys.Back) { // A non-numerical keystroke was pressed. // Set the flag to true and evaluate in KeyPress event. nonNumberEntered = true; } } } //If shift key was pressed, it's not a number. if (Control.ModifierKeys == Keys.Shift) { nonNumberEntered = true; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload