Solved

Vertical Scroll Bars Rich Text Box

Posted on 2004-03-24
4
400 Views
Last Modified: 2008-01-16
How do I get a vertical scroll bar to scroll down with the text entered into Rich Text Box Control?  I have given the rich text box the following properties:

this.displayTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.displayTextBox.Multiline = true;

But the scroll bar stays at the top of the rich text box when the text is greater than the length of the text box!!  Can anyone provide any code so that the scroll bar stays at the bottom of the rich text box?
0
Comment
Question by:garth15
[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
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 250 total points
ID: 10667341
I made small test and found that when user types text to multi-line RichTextBox, it is scrolled down automatically.
However, when text is set from the program, this doesn't happen. To do this you can use ScrollToCaret function:

richTextBox1.Text = "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n2";       // test
richTextBox1.Select(richTextBox1.Text.Length, 0);
richTextBox1.ScrollToCaret();
0
 
LVL 15

Assisted Solution

by:SRigney
SRigney earned 250 total points
ID: 10669193
RichTextBox1.SelectionStart = RichTextBox1.Text.Length;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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