D
DracKewl
In my VBA app I got a big textbox, and need it so that when a user hits the
return key a carriage return happens, and let the user keep typing. This is
driving me nuts! It happens fast but I can see the carriage return happen
but cursor goes back to the last position of the string.
Here is my code
Private Sub ProjectsNotes_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
ProjectsNotes.Text = ProjectsNotes.Text + vbCrLf
ProjectsNotes.SelStart = Len(ProjectsNotes.Text)
ProjectsNotes.SelLength = 0
KeyCode = 0 'I added this so I keep focus.
End If
return key a carriage return happens, and let the user keep typing. This is
driving me nuts! It happens fast but I can see the carriage return happen
but cursor goes back to the last position of the string.
Here is my code
Private Sub ProjectsNotes_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
ProjectsNotes.Text = ProjectsNotes.Text + vbCrLf
ProjectsNotes.SelStart = Len(ProjectsNotes.Text)
ProjectsNotes.SelLength = 0
KeyCode = 0 'I added this so I keep focus.
End If