C#注册窗体热键,没有焦点也可以触发
C#代码
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.A)
{
btnTest_Click(this, EventArgs.Empty);
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.A) { btnTest_Click(this, EventArgs.Empty); } }
2022-03-13 09:50:08
5KB
C#
热键
1