在DELPHI中是这样
var i:integer;
begin
for i:=0 to form1.MDIChildCount-1do
begin
form1.MDIChildren.Free;
form1.MDIChildren.Close;
end
或
for i:=0 to Application.commentcount-1do
begin
if (Application.comments.Class=Tform) and (application.comments.name<>主窗体名) then
Tform(Application.comments).close;
不是子窗体请用这种方案
for i:=0 to Application.commentcount-1do
begin
if (Application.comments.Class=Tform) and (application.comments.name<>主窗体名) then
Tform(Application.comments).close;