用下面的函数判别一个字符是否汉字,然后将文本框中的每一个字符判别一下就可以了.Function IsHz(InputStr As String) As Boolean
Dim InStrByte() As Byte
Dim InputStrLenB As Integer
InStrByte = InputStr
InputStrLenB = LenB(inputstring)
IsHz = False
If Val(InStrByte(1)) <> 0 Then
IsHz = True
End IfEnd Function
Dim InStrByte() As Byte
Dim InputStrLenB As Integer
InStrByte = InputStr
InputStrLenB = LenB(inputstring)
IsHz = False
If Val(InStrByte(1)) <> 0 Then
IsHz = True
End IfEnd Function
Dim lenAll As Long
Dim lenTrue As Long
Dim lenHz As Long
lenAll = Len(HzString) '返回完整字长(汉字算一个字节)
lenTrue = LenB(StrConv(HzString, vbFromUnicode)) '返回真实字长(汉字算两个字节,英文算一个)
lenHz = lenTrue - lenAll '计算出汉字的数量
If lenHz >= 0 Then
CountHzTotal = lenHz '返回正确汉字数目
Else
CountHzTotal = -1 '有错误
End If
End Function酷吧!记得给分哦:)