如何检查是否按下了箭头键(dunno,右键)?
答案 0 :(得分:1)
只需在表单加载
上将KeyPreview
属性设置为true即可
之后,您可以使用KeyDown / KeyPress事件。
Private Sub main_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
'40 = ArrowkeyDown 38= ArrowKeyUp
If Not e.KeyValue = 40 AndAlso Not e.KeyValue = 38 Then Exit Sub
'Key Down / Up Code
End Sub