展开全部
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
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询