Scalabium Software

SMExport advertising
Knowledge for your independence'.
Home Delphi and C++Builder tips


#102: How can I scroll a text in memo in the run-time?

In few tasks I needs to add a some strings in end of TMemo in run-time but after that I must show a first strings. For example, it's very useful in logging system when you inserted a lot of status messages but user must view a first lines.

This task can be solved in two lines of code:

  <.. to add a lines ..>
  {set a current position of cursor to start}
  SendMessage(Memo1.Handle, EM_SETSEL, 0, 0);

  {scroll a memo to start position}
  SendMessage(Memo1.Handle, EM_SCROLLCARET, 0, 0);

As alternative method you can set a Memo1.Visible := False before insertion of new strings and after that to set a Memo1.Visible := True. You'll receive a same result.


Published: October 26, 2000

See also
 
ABA Spreadsheet Convert
Paradox to Text converter
dBase Viewer
Clarion Viewer
Database Information Manager
ABA Picture Convert
Fast Document Viewer
Word Web-stream
Protected Storage Viewer
Mail parser (ActiveX)
 
 


Contact to webmaster

 

Borland Software Code Gear Scalabium Delphi tips

Copyright© 1998-2018, Scalabium Software. All rights reserved.
webmaster@scalabium.com

SMExport/SMImport suites