I wonder why this code never runs when I release a key.
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
MessageBox.Show("It works!");
}
In designer this code is added as usual:
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
However events like Form load works perfect. Is there any common solutions for this problem?
You should set the
KeyPreviewproperty of the form to true, this should work with your code.