scroll winforms textbox to last line

Posted on 2006-11-27
Last Modified: 2012-06-27

I have a multiline textbox I am adding text to, how can I make it scroll to the end of the text?
Question by:zattz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 10

Accepted Solution

Kinger247 earned 63 total points
ID: 18019641
Hi Zattz,

Use this code :

TextBox2.SelectionStart = TextBox2.Text.Length
LVL 43

Assisted Solution

TimCottee earned 62 total points
ID: 18019653
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

Author Comment

ID: 18019929
Dosn't work...

LVL 43

Expert Comment

ID: 18019964

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


Author Comment

ID: 18020064
I do apologise. It does work.

I never noticed I was adding something else to the text after moving the caret...

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.NET MVC -Update model when click on <li> element 29 103
C# Service FileSystemwatcher isse 9 65 figure out error 3 47
SQL Server Serialization error 8 47
In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question