没有实现换行字数的统计,只能在本行计算字数,加了换行的字数,就不行了!!!!
请看代码:
Private Sub Text1_Change()
Dim str As String
Dim T As Integer
Dim tx As Integer
T = 0
For tx = 0 To Len(Text1.Text)
Text1.SelStart = tx
Text1.SelLength = 1
str = Text1.SelText
If str = "," Or str = "。" Or str = "!" Or str = "《" Or str = "》" Or str = "“" Or str = "”" Or str = ":" Or str = "(" Or str = ")" Or str = "(" Or str = ")" Or str = ";" Or str = "、" Or str = "?" Or str = "," Or str = "." Or str = "0" Or str = "1" Or str = "2" Or str = "3" Or str = "4" Or str = "5" Or str = "6" Or str = "7" Or str = "8" Or str = "9" Then T = T + 1
Next tx
T = T / 2
If Text1.Text <> "" Then
Text2.Text = Len(Replace(Text1.Text, " ", "")) - T
请教,谢谢!