Code Snippet
Private Sub AddResult(TextFileName As String)
Dim NewLine As String
If (Trim(tResults.Text).Count > 0) Then
NewLine = vbCrLf + TextFileName
tResults.Text = tResults.Text.Insert(tResults.Text.Count - 1, NewLine)
tResults.SelectionStart = tResults.Text.Count
Else
tResults.Text = TextFileName
End If
End Sub
where tResult is a Multi-Line Text box.
when a new line is to be added to the text box, the display in the text box always returns to the top. Even though the SelectionStart was suggested as a solution.
This function is called from a routine that searches for key words in a bunch of text files so there are times I would like to scroll down to see some of the results but it keeps snapping back to the top.
My question is it even possible to have the textbox behave the way I want it to? Display the scrolled content and have it not jump up to the top when information is added to it?
Thanks, Lance