首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

TFrame 对象的 destroy 重写解决方案

2012-02-21 
TFrame对象的 destroy 重写TContractMain class(TFrame).......publicconstructor Create(AOwner: TComp

TFrame 对象的 destroy 重写
TContractMain = class(TFrame)  
.......
  public
  constructor Create(AOwner: TComponent);Override;

  destructor Destroy; override;
  end


constructor TContractMain.Create(AOwner: TComponent);
begin
  Inherited create(AOwner);

  DModule.GetCompanyInfor(cmBox_Company);
end;

destructor TContractMain.Destroy;
begin
  showmessage('1');


  inherited Destroy;


end;

在使用该 Frame 时 为什么 Destroy 没有执行

[解决办法]
你都没有释放Form3,当然不会执行啦!

Application.CreateForm(TForm3, Form3); 
try
Form3.ShowModal; 
finally
FreeAndNil(Form3);
end;

热点排行