【问题标题】:Keycodes for arrow keys箭头键的键码
【发布时间】:2010-09-24 17:07:25
【问题描述】:

谁能帮我获取 c# .net 按键事件中箭头键的键码?你能帮我摆脱这个检查点吗?

最好的问候, 阿伦。

【问题讨论】:

    标签: c# winforms keypress


    【解决方案1】:

    您可以在此处查找键码: http://msdn.microsoft.com/en-in/library/aa243025(v=vs.60).aspx

    它说:

    vbKeyLeft 37 左箭头键 vbKeyUp 38 向上箭头键 vbKeyRight 39 右箭头键 vbKeyDown 40 向下箭头键

    你可以这样比较

    e.KeyValue==39 
    

    【讨论】:

      【解决方案2】:

      http://msdn.microsoft.com/en-us/library/system.windows.forms.keys.aspx

      Keys.Up、Keys.Left、Keys.Right、Keys.Down。

      【讨论】:

        【解决方案3】:

        您是指 KeyUp 事件吗? KeyPress 不会为 Arrows 触发,并且事件 args 没有 KeyCode 属性,但对于 keyUp 事件中的 Arrow Keys,它们是:

        Keys.Up、Keys.Down、Keys.Left、Keys.right

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-03-16
          • 2021-09-02
          • 1970-01-01
          • 2010-09-05
          相关资源
          最近更新 更多