Title: How to UNDO in memo fields
Memo1.Perform(EM_UNDO, 0, 0);
// To Detect if Undo imformation is available:
ButtonUndo.Enabled := Memo1.Perform(EM_CANUNDO, 0, 0);
ButtonUndo.Enabled := Memo1.CanUndo; // in Delphi 4 or higher
// To clear the Undo buffer:
Memo1.Perform(EM_EMPTYUNDOBUFFER, 0, 0);
Memo1.ClearUndo; // in Delphi 4 or higher