Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
keypress event c#
SUBMITTED BY:
menamagice
DATE:
Aug. 9, 2017, 1:59 a.m.
FORMAT:
Text only
SIZE:
465 Bytes
Raw
Download
Tweet
HITS:
219
Go to comments
Report
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?
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus