definier das Event einfach neu. Mal nen Beispiel mit OnClick
Delphi-Quellcode:
TNewButton = class(TButton)
private
FNewOnClick: TNotifyEvent;
procedure FOnClickProc(Sender: TObject);
public
constructor Create(AOwner: TComponent); override;
published
property OnClick: TNotifyEvent read FNewOnClick write FNewOnClick;
end;
constructor TNewButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
inherited OnClick := FOnClickProc;
end;
procedure TNewButton.FOnClickProc(Sender: TObject);
begin
if Assigned(FNewOnClick) then FNewOnClick(Sender);
//do something other on Click too
end;