«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to control the scroll buffer of a TMemo

   
Question
I would like the TMemo object to have a 250 line scroll buffer. In other words, when the 251st line is added, the first line is removed from the TMemo object. Is there a way to accomplish this without having to copy each string from index n to index n - 1 each time the 250th line is added?

You can use TStrings' Delete method and pass the index to it.

if memo1.Lines.Count = 251 then
  Memo1.lines.Delete(0);
Original resource: The Delphi Pool
Author: Eddie Shipman
Added: 2009-09-14
Last updated: 2009-09-14

« Return to contents »