如何使MDI子窗口中的弹出的窗口也变成MDI子窗口

解决方案 »

  1.   

      with TForm.Create(Self) do
      begin
        FormStyle := fsMDIChild;
        Show;
        Caption := 'Budded'
      end;
      

  2.   

    子窗体的Owner 应该是MDI主窗体。
    with TForm.Create(Application.MainForm) do
    begin
        FormStyle := fsMDIChild;
        Show;
        Caption := 'Budded'
     end;
      

  3.   

    function Tmain.Findform(Caption: string): Bool;
    var
      i: integer;
    begin
      for i:=0 to  Main.MDIChildCount do
       Begin
          if Main.MDIChildren[i].Caption =Caption then
            Begin
               SendMessage(Mdichildren[i].Handle ,WM_SYSCOMMAND,SC_restore,0);
               Mdichildren[i].Enabled :=true;
               Mdichildren[i].SetFocus ;
               Mdichildren[i].Show ;
               result:=True;
               Break;
            End
          Else
               result:=False;
       End;
    end;---
    procedure Tmain.qClick(Sender: TObject);
    Var
      nowform: TSumAccount;----子窗体名称
    begin
        if Findform('Caption)= False then
         Begin
            nowform:=TSumAccount.Create(Application);
            nowform.Caption :='Caption'; //Caption窗体名称
         End;
    End;
      

  4.   

    FormStyle   :=   fsMDIChild;