1. Home
  2. Computing & Technology
  3. Delphi Programming

Scrolling Memo text from code

By , About.com Guide

If you need to scroll the text in a Memo control, use the following procedure:

~~~~~~~~~~~~~~~~~~~~~~~~~
procedure MemoScrollDown(Memo: TMemo) ;
var
  ScrollMessage:TWMVScroll;
  i:integer;
begin
  ScrollMessage.Msg:=WM_VScroll;
  for i := 0 to Memo.Lines.Count do
  begin
   ScrollMessage.ScrollCode:=sb_LineDown;
   ScrollMessage.Pos:=0;
   Memo.Dispatch(ScrollMessage) ;
  end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Ever needed to set some additional properties to the standard Memo component? By default you use the Tmemo when you need a standard Windows multiline edit control on a form. Here are some nifty TMemo related tips and tricks

Delphi tips navigator:
» Abort a loop by pressing a key
« Label: FocusControl

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Using VCL Components
  5. TMemo, TRichEdit
  6. Scrolling Memo text from code

©2009 About.com, a part of The New York Times Company.

All rights reserved.