KeyDown : recognizing multiple keys

后端 未结 13 2656
悲&欢浪女
悲&欢浪女 2020-12-03 02:47

How can I determine in KeyDown that CtrlUp was pressed.

private void listView1_KeyDown(object sender, KeyEventArgs e)
{
           


        
相关标签:
13条回答
  • 2020-12-03 03:26

    You can check the modifiers of the KeyEventArgs like so:

    private void listView1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Up && e.Modifiers == Keys.Control)
        {
            //do stuff
        }
    }  
    

    MSDN reference

    0 讨论(0)
提交回复
热议问题