代码如下: Private Sub Command1_Click()
Dim i As Integer
Dim strText As String
Dim Char As String
Dim n1 As Integer, n2 As Integer, n3 As Integer
strText = Text1.Text
For i = 1 To Len(strText)
Char = Mid$(strText, i, 1)
If "0" <= Char And Char <= "9" Then
n1 = n1 + 1
ElseIf ("A" <= Char And Char <= "Z") Or ("a" <= Char And Char <= "z") Then
n2 = n2 + 1
Else
n3 = n3 + 1
End If
Next
Text2.Text = n1
Text3.Text = n2
Text4.Text = n3
End Sub