S
stanely
Unregistered / Unconfirmed
GUEST, unregistred user!
type TMy=class(Tpanel)
public
timer:ttimer;
procedure timeontime(sender:tobject);
constructor create(aowner);override;
end;
////////////////////////////
constructor TMy.create(aowner)
begin
inherited create(aowner);
timer:=ttimer.create(self);
timer.inteval=5000;
timer.ontime:=timerontime;
end;
procedure TMy.timerontime(sender:tobject);
begin
//在这里写什么可以让timer被创建5秒以后free这个属于TMy的对象自己呢?
end;
public
timer:ttimer;
procedure timeontime(sender:tobject);
constructor create(aowner);override;
end;
////////////////////////////
constructor TMy.create(aowner)
begin
inherited create(aowner);
timer:=ttimer.create(self);
timer.inteval=5000;
timer.ontime:=timerontime;
end;
procedure TMy.timerontime(sender:tobject);
begin
//在这里写什么可以让timer被创建5秒以后free这个属于TMy的对象自己呢?
end;