打开窗体后,想通过直接按小键盘“+”,“-”键增加或减少窗体数量文本框的数值,在窗体的"击键"事件代码如下:Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 107
MsgBox "+"
Case 109
MsgBox "-"
End Select
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 97
MsgBox "A"
Case 65
MsgBox "a"
End Select
End Sub作者: xinrenq 时间: 2016-7-11 12:29
看看有个窗体属性叫【键预览】即窗体属性:KeyPreview
调整为“是”(True)
这个类似于窗体对按键响应的开关作者: VulcanTerry 时间: 2016-7-28 00:44
先试试,谢谢