![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
2个回答
展开全部
Private Sub Command1_Click()
Dim a As Integer
a = Asc(Text1.Text)
Debug.Print a
If a >= 49 And a <= 57 Then
Print "数字"
ElseIf (a >= 65 And a <= 90) Or (a >= 97 And a <= 122) Then
Print "字母"
Else
Print "符号"
End If
End Sub
Dim a As Integer
a = Asc(Text1.Text)
Debug.Print a
If a >= 49 And a <= 57 Then
Print "数字"
ElseIf (a >= 65 And a <= 90) Or (a >= 97 And a <= 122) Then
Print "字母"
Else
Print "符号"
End If
End Sub
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then
MsgBox "数字!", 65, "Msgbox例子"
ElseIf (KeyAscii >= Asc("a") And KeyAscii <= Asc("z")) Or (KeyAscii >= Asc("A") And KeyAscii <= Asc("Z")) Then
MsgBox "字母!", 65, "Msgbox例子"
Else
MsgBox "符号!", 65, "Msgbox例子"
End If
End Sub
If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then
MsgBox "数字!", 65, "Msgbox例子"
ElseIf (KeyAscii >= Asc("a") And KeyAscii <= Asc("z")) Or (KeyAscii >= Asc("A") And KeyAscii <= Asc("Z")) Then
MsgBox "字母!", 65, "Msgbox例子"
Else
MsgBox "符号!", 65, "Msgbox例子"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询