J
jiefeij
Unregistered / Unconfirmed
GUEST, unregistred user!
var CurrentForm:Tform;//全局变量,当前活动FORM
procedure closeform;
begin
if FrmMain.MDIChildCount>1 then
begin
CurrentForm.Close;
CurrentForm.Free;
CurrentForm :=frmMain.ActiveMDIChild ;
CurrentForm.WindowState := wsMaximized;
end
else
end;
CURRENTFORM是当前活动窗体。frmMain是主窗口。
当打开多个窗口时,用以上过程关闭子窗口时,有时会出现
access violation at address 00000021.read of address 00000021错误。有时又很正常。
procedure closeform;
begin
if FrmMain.MDIChildCount>1 then
begin
CurrentForm.Close;
CurrentForm.Free;
CurrentForm :=frmMain.ActiveMDIChild ;
CurrentForm.WindowState := wsMaximized;
end
else
end;
CURRENTFORM是当前活动窗体。frmMain是主窗口。
当打开多个窗口时,用以上过程关闭子窗口时,有时会出现
access violation at address 00000021.read of address 00000021错误。有时又很正常。