scroll winforms textbox to last line

Hi

I have a multiline textbox I am adding text to, how can I make it scroll to the end of the text?
zattzAsked:
Who is Participating?
 
Kinger247Commented:
Hi Zattz,

Use this code :

TextBox2.SelectionStart = TextBox2.Text.Length
TextBox2.ScrollToCaret()
0
 
TimCotteeHead of Software ServicesCommented:
Hi zattz,

With TextBox1
        .SelectionStart = .TextLength 'Move the insertion point to the end of the text
        .ScrollToCaret() 'Move the scroll position to the current insertion point
        .Focus() 'Focus on the textbox (if we have clicked a button to do this for example).
End With

Tim Cottee
0
 
zattzAuthor Commented:
Dosn't work...

0
 
TimCotteeHead of Software ServicesCommented:
zattz,

Which one? What happens? Is this being run from a button or some other event?

Tim
0
 
zattzAuthor Commented:
I do apologise. It does work.

I never noticed I was adding something else to the text after moving the caret...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.