vb 变量C为文本框输入的一个字符,判断该字符是大小写字母、数字还是其他变量,必须用到下面的程序代码
Ifc>="A"Andc<="Z"ThenPrint"是大写字母"ElseIfc>="a"Andc<="z"Then.Print"是小写字母"ElseIfc>="0"An...
If c >= "A" And c <= "Z" Then
Print "是大写字母"
ElseIf c >= "a" And c <= "z" Then.Print "是小写字母"
ElseIf c >= "0" And c <= "9" Then
Print "是数字"
Else
Print "是其他字符"
End If 展开
Print "是大写字母"
ElseIf c >= "a" And c <= "z" Then.Print "是小写字母"
ElseIf c >= "0" And c <= "9" Then
Print "是数字"
Else
Print "是其他字符"
End If 展开
4个回答
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim c As String
c = Chr(KeyAscii)
If c >= "A" And c <= "Z" Then
Print "是大写字母野早如"
ElseIf c >= "a" And c <= "z" Then
Print "是睁源小写字母"
ElseIf c >= "0" And c <= "9" Then
Print "是数字"
Else
Print "是其他字颂启符"
End If
End Sub
Dim c As String
c = Chr(KeyAscii)
If c >= "A" And c <= "Z" Then
Print "是大写字母野早如"
ElseIf c >= "a" And c <= "z" Then
Print "是睁源小写字母"
ElseIf c >= "0" And c <= "9" Then
Print "是数字"
Else
Print "是其他字颂启符"
End If
End Sub
展开全部
楼主,你结尾差一个End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是什么问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |