var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
val1 := StrToInt(Edit1.Text);
val2 := StrToInt(Edit2.Text);
if(val1< 100)and(val2< 100) then
begin
res := val1*val2;
Edit3.Text := IntToStr(res);
end
else
if assigned(FTooBig) then OnTooBig(Self);
end;
procedure TForm1.TooBig1(Sender: TObject);
begin
Application.MessageBox('Too Big',' Test Event! ',MB_OK);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
val1:=1;
val2:=1;
FTooBig := TooBig1;{使事件处理指针指向事件处理器}
end;