Board index » delphi » delete last line of memo..

delete last line of memo..

Hi Siang,

To delete the last line, you'd do this:

    Memo1.Items.Delete( Memo1.Items.Count-1 );

To delete the first line, you'd do this:

    Memo1.Items.Delete(0);

Best regards,

Loren Scott
President/CEO
Vista Software
http://www.VistaSoftware.com

 

Re:delete last line of memo..


let say i do this 10 times.
        Memo1.Lines.Add('A');

then there will be 10 line in the memo. if i wanna delete the last line, how do
i do so???? Memo1.Lines.Clear will delete all lines...!!!!!

Re:delete last line of memo..


Try

Memo1.Lines.Delete(Memo1.Lines.Count - 1);

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Other Threads