请各位高手运行一下如下代码:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode < 48 Or KeyCode > 57 Then
MsgBox "请输入数字"
Text1.SetFocus
Dim temp As String
temp = Text1.Text
If Trim(temp) <> "" Then
Text1.Text = Left(temp, Len(temp) - 1)
Text1.SelStart = Len(Text1.Text)
End If
End If
End sub
在程序中不知各位能不能用小键盘输入数字,我的不能。大键盘上的数字键对应的ascii码和小键盘上对应的ascii码是一样的,为什么用大键盘能输入,用小键盘却不能输入,真搞不懂!不知有没办法解决。