Solved

scroll winforms textbox to last line

Posted on 2006-11-27
5
1,193 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
[X]
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
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

624 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