Wednesday, July 7, 2010

Keypress event not working C#

private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
MessageBox.Show(e.KeyChar.ToString(), "Your input");
}


IF NOT EVENT IS FIRE>>>>>>>>>>>>>>>>>>>>>
Need to set the KeyPreview Property of your Form to True so it will recognize the key press event.

No comments:

Post a Comment