How to use KeyPressEvent in correct way
try to create HotKeys for my forms
code
private void FormMain_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
{
MessageBox.Show("e");
}
}
works for one key, but if I whant to use combination of keys like CTRL+N,
try to use if (e.KeyChar == (char)Keys.Enter && e.KeyChar == (char)Keys.N)
- but it's not working. I'm I right - using such code for keys
combination?
No comments:
Post a Comment