7,763
社区成员
发帖
与我相关
我的任务
分享
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim i%
i = KeyAscii Or 32
If (i >= 97 And i <= 122) Then
Debug.Print "输入正确!"
Else
KeyAscii = 0
Debug.Print "输入错误!"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii <= 122) Then
Debug.Print "输入正确!"
Else
KeyAscii = 0
Debug.Print "输入错误!"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not Chr(KeyAscii) Like "[a-zA-Z]" Then
KeyAscii = 0
Debug.Print "输入错误!"
Else
Debug.Print "输入正确!"
End If
End Sub