procedure TForms1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action:=cafree;
Forms1:=nil;////这一句
end;
目前这样关子窗口可以的,但我不想写Forms1,有没办法用其它的变量来代替。
begin
action:=cafree;
Forms1:=nil;////这一句
end;
目前这样关子窗口可以的,但我不想写Forms1,有没办法用其它的变量来代替。
Sender := nil;
lz另一个地方用了
if Assigned(Forms1) then估计这个 Forms1 类型的有很多个,所以不想每个都打。
var
f :TForms1;
begin
if not (Sender) is TForms1 then exit;
f := Sender as TForms1;
action:=cafree;
f := nil;
end;