我想在文本框中执行一个关键事件检测。按键应该是Ctrl+K的组合,有什么好的方法吗?
最佳答案
在TextBox的KeyDown事件中,使用:
if (e.Control && e.KeyCode == Keys.K) {
//Your code here
}
关于c# - 检测组合键事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1107492/
我想在文本框中执行一个关键事件检测。按键应该是Ctrl+K的组合,有什么好的方法吗?
最佳答案
在TextBox的KeyDown事件中,使用:
if (e.Control && e.KeyCode == Keys.K) {
//Your code here
}
关于c# - 检测组合键事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1107492/