现在的位置: 首页 > 综合 > 正文

vb 中检测是不是汉字(简单版)

2012年03月21日 ⁄ 综合 ⁄ 共 224字 ⁄ 字号 评论关闭
Dim str As String
Dim i
Dim charPra As String
str = Trim(Text1.Text)
For i = 1 To Len(str)
   If Asc(Left(str, 1)) < 0 Then
     'MsgBox Left(str, 1)
      Text1.Text = ""
      Text1.SelStart = 0
      Text1.SelLength = 10
      Cancel = True

   End If
str = Mid(str, 2)
Next i

抱歉!评论已关闭.