Private Sub Combo1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
MsgBox KeyCode
If KeyCode = 38 Then aaaagq_ReCall
If KeyCode = 40 Then SendKeys "{TAB}"
End Sub
没有获得上下,请问如何解决?谢谢大家
form.keypreview 设置为true
...全文
1095打赏收藏
在combo里如何捕捉上下方向键?
Private Sub Combo1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer) MsgBox KeyCode If KeyCode = 38 Then aaaagq_ReCall If KeyCode = 40 Then SendKeys "{TAB}" End Sub 没有获得上下,请问如何解决?谢谢大家 form.keypreview 设置为true
'用下面的代码试一试,注意你的Index值:
Private Sub Combo1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then MsgBox "上"
If KeyCode = 40 Then MsgBox "下"
End Sub
'Combo1.Locked=True,锁定输入数据
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
Combo1.Locked = False
End Sub
Private Sub Combo1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 38 Then MsgBox "上"
If KeyCode = 40 Then MsgBox "下"
Combo1.Locked = True
End Sub
Private Sub Combo1_KeyDown(KeyCode As Integer, Shift As Integer)
MsgBox KeyCode
If KeyCode = 38 Then MsgBox "上"
If KeyCode = 40 Then MsgBox "下"
End Sub