[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Scrolling TRichEdit and TListBox

Posted on 1998-08-09
Medium Priority
Last Modified: 2010-04-04
I want to scroll RichEdit and TListBox components automaticly to the bottom when something is added..
How do I do that?
Question by:mortenmo
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

Accepted Solution

erajoj earned 200 total points
ID: 1361755
Here is an example of one way to solve it:

  MyString: string;
  MyString := 'Whatever';
  ListBox1.ItemIndex := ListBox1.Items.Add( MyString );
  RichEdit1.Lines.Add( MyString );

  //  RichEdit1.SelStart := RichEdit1.SelStart - 2; // optional, preceed the CR+LF

  // RichEdit1.SelStart := RichEdit1.SelStart - Length( MyString ) - 2; // optional, start of added string
  // RichEdit1.SelLength := Length( MyString );

  SendMessage( RichEdit1.Handle, EM_SCROLLCARET, 0, 0 );

Uncomment the commented lines to get variations on the richedit selections after adding.

/// John
LVL 10

Expert Comment

ID: 1361756
For the listbox, you can also use this way....

Listbox1.ItemIndex := Lo(listbox1.Items.count - 1);

Hope this helps a bit!

Viktor Ivanov

Author Comment

ID: 1361757
Thanks ;)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

656 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