给你个简单的例子
TEvent = procedure(Value: Integer) of object;
TC = class
private
FOnEvent: TEvent;
procedure TrigerEvent(Value: Integer);
procedure DoSomeSevive(X, Y: Integer);
published
property MyEvent: TEvent read FOnEvent write FOnEvent;
end;
implementation
procedure TC.TrigerEvent(Value: Integer);
begin
if Assigned(FOnEvent) then
FOnEvent(Value);
end;
procedure TC.DoSomeSevive(X, Y: Integer);
begin
if x - y > 100 then
TrigerEvent(100);
end;