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

x
?
Solved

Scrolling TRichEdit and TListBox

Posted on 1998-08-09
3
Medium Priority
?
288 Views
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?
0
Comment
Question by:mortenmo
[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
3 Comments
 
LVL 4

Accepted Solution

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

var
  MyString: string;
begin
  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
0
 
LVL 10

Expert Comment

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

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

Hope this helps a bit!

Regards,
Viktor Ivanov
0
 
LVL 1

Author Comment

by:mortenmo
ID: 1361757
Thanks ;)
0

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