Ограничение на количество строк в TMemo
Оформил: DeeCo
Автор: http://www.swissdelphicenter.ch
procedure TForm1.Memo1Change(Sender: TObject);
const
MaxLineCount = 5;
begin
if Memo1.Lines.Count > MaxLineCount then
// undo the last change
// letze Дnderung rьckgдngig machen
Memo1.Perform(EM_UNDO, 0, 0);
// The EM_EMPTYUNDOBUFFER message clears the undo flag,
// which means that you can no longer undo your last change
// to the edit control.
// Die Message EM_EMPTYUNDOBUFFER lцscht das UnDo Flag,
// damit kann die letzte Дnderung nicht Rьckgдngig gemacht werden.
Memo1.Perform(EM_EMPTYUNDOBUFFER, 0, 0);
end;
|