if (e.KeyCode == Keys.F4)
{
Method();
}
如果我按两个键,我怎么能这样做?例如输入+ F4?
答案 0 :(得分:0)
FormLoad()
{
this.KeyPreview = true;
this.KeyDown += new KeyEventHandler(Form1_KeyDown);
}
void Form1_KeyDown(object sender, KeyEventArgs e)
{
//Works for Ctrl+F4
if (e.Control && e.KeyCode == Keys.F4)
{
//Do something
}
}
看看这对你有用。