Dim n1 As Integer, n2 As Integer, n3 As Integer
Private Sub txtinput_Change()
Dim s As String
s = Right(txtinput.Text, 1)
If s <> "." Then
If UCase(s) >= "A" And UCase(s) <= "z" Then
n1 = n1 + 1
txtletter.Text = n1
ElseIf s >= "0" And s <= "9" Then
n2 = n2 + 1
txtdigital.Text = n2
Else
n3 = n3 + 1
txtother.Text = n3
End If
Else
txtinput.Enabled = False
End If
End Sub
调试了一下,为什么可以输入字母数字各种符号包括空格,就是无法输入回车,也就是回车按下去没有反应,教科书上说回车也是字符,是可以输入的