【问题标题】:c# simple key press detectionc# 简单按键检测
【发布时间】:2015-07-22 06:53:49
【问题描述】:

我想检测(尽可能简单)“ctrl+o”键,然后显示一条消息。 我试过了: enter link description here enter link description here

和其他 4 个链接,我不能给你看。请帮忙。

【问题讨论】:

标签: c# key detect


【解决方案1】:

试试这个。它对我有用。

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
     if (e.Modifiers == Keys.Control && e.KeyCode.ToString() == "O")
    {
        MessageBox.Show("ctrl + o pressed");
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-13
    • 2013-08-25
    • 1970-01-01
    • 2013-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多