The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,261 other subscribers

autoscrolling memo in delphi – Stack Overflow

Posted by jpluimers on 2013/04/03

Just found this great answer by vcldeveloper to autoscroll a readonly logging memo in Delphi which works from Delphi 1 and up (:

For such a simple task, you don’t need to buy a commercial component! All you need to do is to send an EM_LINESCROLL message to that memo control, to make it scroll to the last line:

procedure ScrollToLastLine(Memo: TMemo);
begin
  SendMessage(Memo.Handle, EM_LINESCROLL, 0,Memo.Lines.Count);
end;

If your memo is read-only to users and is updated automatically by the application, you can put a call to the above procedure in its OnChange event-handler, so that whenever the text inside the memo is changed, it is automatically scrolled down to the last line.

–jeroen

via: autoscrolling memo in delphi – Stack Overflow.

9 Responses to “autoscrolling memo in delphi – Stack Overflow”

  1. Nice!

  2. Stefan said

    Does this not work for you, which also works for RichEditMemos etc?

    mLog.Perform(WM_VSCROLL, SB_BOTTOM, SB_THUMBTRACK);

  3. sckfjsdhfjk said

    i was wondering if there is a way to auto scroll the memo in a human reading pace?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.