1. for i:= 0 to fMDI.MDIChildCount do
if fmdi.MDIChildren.Active = true then
begin
----
end;
2. for i:=fMDI.MDIChildCount-1 downto 0 do
fmdi.MDIChildren.Close;
注:MDICHILD窗体中的 TMDIChild.FormCloses事件
procedure TMDIChild.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;