procedure TForm1.FormCreate(Sender: TObject);var i:integer;
begin
for i:=0 to mdichildcount-1 do
   mdichildren[i].close;end;
该怎么做呢?

解决方案 »

  1.   

    到Project菜单选Options将子窗体加到右边去就可以了
      

  2.   

    这样子当然不行了,你在CSDN上找一找有关MDI的贴子,有很多这方便的信息的!建议还是先看看书再做吧!
      

  3.   

    为什么不直接create一个窗口呢?
      

  4.   

    到Project菜单选Options将子窗体加到右边去就可以了
      

  5.   

    最好不要用mdi,我觉得毛病很多阿,不过楼上说得没错
      

  6.   

    到Project菜单选Options将子窗体加到右边去就可以了
      

  7.   

    上说的对是因为你的子窗口是自动建立的你的把它们设成手动建立
    在用的时候再建立就可以了,
    try
     Form1:=TForm1.create(application);
     form1.showmodal;
    finally
     form1.free;
    end;
      

  8.   

    把子窗体的自动建立去掉就行了
    显示子窗体可以用下面的方法procedure OpenForm(FormClass: TFormClass; var fm; AOwner:TComponent);
    var
      i: integer;
      Child:TForm;
    begin
      for i := 0 to Screen.FormCount -1 do
          if Screen.Forms[i].ClassType=FormClass then
          begin
            Child:=Screen.Forms[i];
            if Child.WindowState=wsMinimized then
               ShowWindow(Child.handle,SW_SHOWNORMAL)
            else
               ShowWindow(Child.handle,SW_SHOWNA);
            if (not Child.Visible) then Child.Visible:=True;
            Child.BringToFront;
            Child.Setfocus;
            TForm(fm):=Child;
            exit;
          end;
      Child:=TForm(FormClass.NewInstance);
      TForm(fm):=Child;
      Child.Create(AOwner);
    end;比如显示Form1
    OpenForm(TForm1,Form,Self);
    就可以了
      

  9.   

    写错了,应该是:
    OpenForm(TForm1,Form1,Self);