procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
for i:=screen.FormCount-1 downto 0 do
if Screen.Forms.Showing
and (Screen.Forms<>Application.MainForm)
and (Screen.Forms.Name<>'FrmMain')
and (Screen.Forms.Name<>'FrmDB')
and (Screen.Forms.Name<>'FrmDB') then Screen.Forms.Close;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
for i := 0 to Application.ComponentCount - 1 do
begin
if (Application.Components is TForm) then
begin
if (Application.Components.Name <> 'FrmMain') or (Application.Components.Name <> 'FrmDB') or (Application.Components.Name <> 'FrmMDIcontrol') then
begin
(Application.Components as TForm).Close;
end;
end;
end;
end;