I wonder if anyone can explain this:-
Create a form with a multi line text box and 2 buttons.
Put the following code under the buttons:-
Private Sub Cmd_Count_Click()
MsgBox Len(Text1.Text) & " characters.", vbOKOnly
End Sub
Private Sub Cmd_Fill_Click()
Dim X As Long
Dim sTemp As String
For X = 1 To 500
sTemp = sTemp & "A"
Next
Text1.Text = sTemp
End Sub
Run the program and click the fill button, then click the count
button, the message box tells us there are 500 characters in the
text box. No suprises there.
Now select and copy the text in the text box, stop the program
and paste the characters into the text property of the text box.
i.e. fill it at design time.
Run the program again but this time click the count button first.
I see 502 characters reported. I can't find the extra 2.
Any ideas ?
Create a form with a multi line text box and 2 buttons.
Put the following code under the buttons:-
Private Sub Cmd_Count_Click()
MsgBox Len(Text1.Text) & " characters.", vbOKOnly
End Sub
Private Sub Cmd_Fill_Click()
Dim X As Long
Dim sTemp As String
For X = 1 To 500
sTemp = sTemp & "A"
Next
Text1.Text = sTemp
End Sub
Run the program and click the fill button, then click the count
button, the message box tells us there are 500 characters in the
text box. No suprises there.
Now select and copy the text in the text box, stop the program
and paste the characters into the text property of the text box.
i.e. fill it at design time.
Run the program again but this time click the count button first.
I see 502 characters reported. I can't find the extra 2.
Any ideas ?