C# - KeyPress Event Mapping


Key press event cannot get the following keys

1. Tab
2. Insert, Delete
3. Home
4. End
5. Page up and down
6. F1 - F12
7. Ctrl, Alt, Shift
8. Arrow

Otherwise, you can get the key code by


private void KeyPress(object sender, KeyPressEventArgs e)
{
//capture enter key press
if (e.KeyChar == (char)Keys.Enter)
{
//enter key obtained
}
}

Comments

Popular Posts