procedure TMainForm.CreateMDIChild(const Name: string); var Child: TMDIChild; begin { create a new MDI child window } Perform(WM_SETREDRAW, 0, 0); //锁屏幕 Child := TMDIChild.Create(Application); Child.WindowState := wsMaximized; //假设在这里将新建的子窗体设为最大化 //或设置子窗体的Width和Height都可以 Child.Caption := Name; if FileExists(Name) then Child.Memo1.Lines.LoadFromFile(Name); Perform(WM_SETREDRAW, 1, 0); //解锁屏幕并重画 RedrawWindow(Handle, Nil, 0, RDW_FRAME + RDW_INVALIDATE + RDW_ALLCHILDREN + RDW_NOINTERNALPAINT); end;
http://blog.csdn.net/shuaihj/article/details/6129278