In Visual Basic 2010, how do I always make it so the last line is visible?

Mark

New member
I have a multiline text box which is updated every few seconds by a new line appearing with the said update. Something like this:

Hello!
How are you
Fine

And so on. The original is there, my program just adds new lines with more text. My problem is that when the text exceeds the bounds of the box and the scroll bar appears, I have to scroll down to see the latest updated text. How can I make it so that the scroll bar is always set at the bottom? I'm currently using this code but it doesn't seem to work.

Private Sub txtStatus_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtStatus.TextChanged
txtStatus.SelectionStart = Len(txtStatus.Text)
txtStatus.SelectionLength = 0
End Sub

Thanks and much appreciated.
 
Back
Top