Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 0 Then
MsgBox "输入的是中文"
ElseIf KeyAscii >= Asc("0") And KeyAscii <= "9" Then
MsgBox "输入是的数字"
ElseIf KeyAscii >= "a" And KeyAscii <= "z" Or _
KeyAscii >= "A" And KeyAscii <= "Z" Then
MsgBox "输入是的字母"
End If
End Sub
Private Sub Command1_Click()
Select Case Asc(Text1.Text)
Case 48 To 57
MsgBox "数字"
Case Is < 0
MsgBox "中文"
Case Else
MsgBox "英文"
End Select
End Sub
以上代码判断text1中第一个字符,如果要判断其他的字符,只需将text1.text改为相应表达式即可。