Multi Line TextBox

solus

Freshman
Joined
Apr 5, 2003
Location
Phoenix
How can i set a TextBox to show the last line when it's multi line?

I'm trying to make it a kind of status window, so i enter "some text" into it, then later "some more text" and eventually it's got enough lines that the vertical scroll bar shows up, but it stays at the top instead of scrolling down to show the new line.

I figure it's just a simple "scroll to line" or something, any input? I'm using c#.
 

solus

Freshman
Joined
Apr 5, 2003
Location
Phoenix
Oh and another thing, how can i make it so the text in the TextBox appears at the bottom instead of the top when there's only one line?
 

Robby

Ultimate Contributor
Joined
Nov 17, 2002
Location
Montreal, Ca.
try this...
Visual Basic:
'Place the caret at the end of the textbox
TextBox1.SelectionStart = TextBox1.Text.Length 

'scroll to caret (as the method says)
TextBox1.ScrollToCaret()

'all subsequent enties should be appended
TextBox1.AppendText("Some additional text")
 
Top Bottom