我想在创建一个窗口form2后将其显示在先前创建的窗口form1的panel1包容控件中,并且填充满panel1??请高手给出处理办法,谢谢!!

解决方案 »

  1.   


     Form2.Parent:=Form1.Panel1;
     Form2.Align:=alClient;
    就可以了
      

  2.   

      Form2.ManualDock(Form1.Panel1);
      Form2.Align := alClient;
      

  3.   

    谢谢yangtxiang2007,jwpl190我使用这样的命令打开窗口,但是窗口上的控件不可点,什么原因?
      try
       Application.CreateForm(TPub_SetupPrinterForm, Pub_SetupPrinterForm);
       Pub_SetupPrinterForm.ManualDock(MainForm.Panel1);
       Pub_SetupPrinterForm.Align:=alClient;
       Pub_SetupPrinterForm.ShowModal;
      finally
       Pub_SetupPrinterForm.free;
      end;
      

  4.   

      try
          Application.CreateForm(TPub_SetupPrinterForm,   Pub_SetupPrinterForm);
          Pub_SetupPrinterForm.ManualDock(MainForm.Panel1);
          Pub_SetupPrinterForm.Align:=alClient;
          Pub_SetupPrinterForm.ShowModal;  //这句就是垄断消息了。
    //应该使用 Pub_SetupPrinterForm.Visible=True;
        finally
          Pub_SetupPrinterForm.free;
        end; 
      

  5.   

     Application.CreateForm(TPub_SetupPrinterForm,Pub_SetupPrinterForm); 
     Pub_SetupPrinterForm.ManualDock(MainForm.Panel1); 
     Pub_SetupPrinterForm.Align:=alClient; 
     Pub_SetupPrinterForm.Show;