I have a textbox which I load with a single line of text in Form_Load() and also I have Text1_GotFocus event like this:
When the app loads up you see the single line of text in the textbox and the cursor immediately follows the last character in the text line on the same line. This is because of the GotFocus event
Now if I type something it will enter the characters on that same line and when I click the Enter key I do the following:
Text1.SelStart = Len(Text1.Text)
just like it did in GotFocus event but the cursor does not follow the last character but rather goes to the next line.
Why does it put the cursor on the same line the first time but wont do it any other time?
Code:
Private Sub Text1_GotFocus()
'
' appears to only run on Form load
'
Text1.SelStart = Len(Text1.Text)
End Sub
Now if I type something it will enter the characters on that same line and when I click the Enter key I do the following:
Text1.SelStart = Len(Text1.Text)
just like it did in GotFocus event but the cursor does not follow the last character but rather goes to the next line.
Why does it put the cursor on the same line the first time but wont do it any other time?