Title: limit memo lines?
procedureTForm1.Memo1Change(Sender:TObject);
const
MaxLineCount=5;
begin
ifMemo1.Lines.CountMaxLineCountthen
//undothelastchange
//letzenderungrckgngigmachen
Memo1.Perform(EM_UNDO,0,0);
//TheEM_EMPTYUNDOBUFFERmessageclearstheundoflag,
//whichmeansthatyoucannolongerundoyourlastchange
//totheeditcontrol.
//DieMessageEM_EMPTYUNDOBUFFERlschtdasUnDoFlag,
//damitkanndieletztenderungnichtRckgngiggemachtwerden.
Memo1.Perform(EM_EMPTYUNDOBUFFER,0,0);
end;