Solved

scroll winforms textbox to last line

Posted on 2006-11-27
5
1,157 Views
Last Modified: 2012-06-27
Hi

I have a multiline textbox I am adding text to, how can I make it scroll to the end of the text?
0
Comment
Question by:zattz
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
Kinger247 earned 63 total points
ID: 18019641
Hi Zattz,

Use this code :

TextBox2.SelectionStart = TextBox2.Text.Length
TextBox2.ScrollToCaret()
0
 
LVL 43

Assisted Solution

by:TimCottee
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
0
 

Author Comment

by:zattz
ID: 18019929
Dosn't work...

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 18019964
zattz,

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

Tim
0
 

Author Comment

by:zattz
ID: 18020064
I do apologise. It does work.

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now