请问各位大侠,我做了一个父窗口和n个子窗口,我不想在子窗口最大化时与父窗口成为一个窗口(没有了子窗口的标题栏),怎么做?????急啊

解决方案 »

  1.   

    FromStyle 改为 fsNormal 可以吗
      

  2.   

    每个窗体加入下面两个函数就可以了
    //Form2是子窗体FormStyle为fsMDIChild
    unit Unit2;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm2 = class(TForm)
      private
        { Private declarations }
        procedure WMMove(var msg:TWMMove);message WM_Move;
        procedure WMSize(var msg:TWMMove);message WM_Size;
      public
        { Public declarations }
      end;
    var
      Form2: TForm2;
    implementation
    {$R *.dfm}
    { TForm2 }
    procedure TForm2.WMMove(var msg: TWMMove);
    begin
      if top<-1 then top:=0  ;
    end;procedure TForm2.WMSize(var msg: TWMMove);
    begin
      if top<-1 then top:=0  ;
    end;end.
      

  3.   


    把子窗口设为 fsNormal .
    然后在Create()中frmChild.Parent:=frmParent.Handle;
      

  4.   

    implementation
    uses unit1; //父窗口是Form1,定义在Unit1中
    {$R *.dfm}//在子窗口的OnResize中写
    procedure TForm2.FormResize(Sender: TObject);
    begin
     if WindowState=wsMaximized then
     begin
      Windowstate:=wsNormal;
      top:=0;
      left:=0;
      width:=Form1.ClientWidth-2;
      height:=Form1.ClientHeight-2;
     end;
    end;