检测组合键事件 [英] Detect Combination Key Event

查看:98
本文介绍了检测组合键事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本框中执行关键事件检测。键应该是Ctrl + K的组合,有没有最好的方法?

I would like to perform a key event detection in textbox. The keys should be a combination of Ctrl+K, is there any best way to do it?

推荐答案

在TextBox的KeyDown事件,使用:

In KeyDown event of TextBox, use:

  if (e.Control && e.KeyCode == Keys.K) {
  //Your code here
  }

这篇关于检测组合键事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆