多标签窗体的释放一法
将释放写在子窗体的FORMCLOSE()里面
procedure TFormLogin.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
FormLogin := nil;
end;
关闭TABSHEET的时候,遍历找到它里面的窗体,然后调用窗体的close()方法
procedure TFormMain.CloseTabsheet;
var
i: Integer;
begin
if RzPageControl1.PageCount <= 0 then Exit;
if RzPageControl1.ActivePage = nil then exit;
for i := 0 to RzPageControl1.ActivePage.ControlCount - 1 do
if RzPageControl1.ActivePage.Controls[i] is TForm then
begin
TForm(RzPageControl1.ActivePage.Controls[i]).Close;
Break;
end;
RzPageControl1.ActivePage.PageControl := nil;
RzPageControl1.ActivePage.Free;
RzPageControl1.SelectNextPage(true);
end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/archive/2010/08/14/2940682.html