handling function key press
<p>I have a C# form with 5 buttons. The users enters the information and depending on the press of a function key, a specific action is performed. <kbd>F9</kbd>-Execute Order, <kbd>F6</kbd>-Save, <kbd>F3</kbd>-LookUp.</p>

<p>I have added the foolowing code:</p>

<p>OnForm_Load</p>

<pre><code>this.KeyUp += new System.Windows.Forms.KeyEventHandler(KeyEvent);
</code></pre>

<p>and </p>

<pre><code>private void KeyEvent(object sender, KeyEventArgs e) //Keyup Event 
    {
        if (e.KeyCode == Keys.F9)
        {
            MessageBox.Show("Function F9"); 
        }
        if (e.KeyCode == Keys.F6)
        {
            MessageBox.Show("Function F6");
        }
        else
            MessageBox.Show("No Function");

    }
</code></pre>

<p>but nothing happens</p>

<p>Thanks</p>
