In other words I want to write something like this:
Code: Select all
procedure TForm1.Memo1Change(Sender: TObject);
var
EventSaver : TEventSaver;
begin
EventSaver.Create(Memo1.OnChange);
Memo1.Lines.Append('This is a new line.');
EventSaver.Free;
end;
I already have such an object but it requires that I pass the type of TNotifyEvent. If I want non-standard events I have to add them to my class.
Thanks for any ideas on how to do this.