Posts
24
Comments
14
Trackbacks
0
How to make text box autoscroll

Today I needed to make a text box auto scrolling in C#.

After reading all the articles I found relevant (only two articles) I was not satisfied and decided to experiment.

As a result in 5 minutes I produced this code:

//Make the text box autoscroll

private void tbMessages_TextChanged(object sender, EventArgs e)

{

//Get the last text position

tbMessages.SelectionStart = tbMessages.Text.Length;

tbMessages.ScrollToCaret();

tbMessages.Refresh();

}

posted on Wednesday, August 06, 2008 11:53 AM Print
Comments
Gravatar
# re: How to make text box autoscroll
Rasmus
11/26/2008 3:36 AM
Thank you. It works and it was easy:)
Gravatar
# re: How to make text box autoscroll
Randy Suzuki
12/23/2008 7:16 PM
Yeah that was easy, easier than i thought. Saved me time thanks man
Gravatar
# re: How to make text box autoscroll
Gena
1/14/2009 12:11 PM
thank u man :)))
Gravatar
# re: How to make text box autoscroll
Kamen
4/6/2009 6:49 AM
Many, many thanks, man!!! Much cleaner than posting messages to the control
Gravatar
# re: How to make text box autoscroll
Prashant Kumbhat
4/16/2009 4:46 PM
There is an alternative way to set the AutoScroll Property of the Form to True. You will notice that any thread or another function appending text to the textbox will result in autoscrolling :-)
Gravatar
# re: How to make text box autoscroll
Jayesh
6/9/2009 9:15 PM
Thank buddy ..
Gravatar
# re: How to make text box autoscroll
Emre Ozcelikel
6/12/2009 2:14 AM
thanx nice one ! im gonna use it on my project..
Gravatar
# re: How to make text box autoscroll
toloachero
9/7/2009 4:03 PM
THANKS! =D
Gravatar
# re: How to make text box autoscroll
Jigo
10/1/2009 2:39 PM
Works great. Thanks a lot.
Gravatar
# re: How to make text box autoscroll
Ameet Parse
10/19/2009 5:58 AM
thx :)

Post Comment

Title *
Name *
Email
Url
Comment *  
 
News
Did you know you can create your own search engine with Google?