Delphi - Hidden MDI child form creation

后端 未结 3 1289
无人及你
无人及你 2021-01-05 22:42

My application has many many mdi forms and they are created after successfull user login. How can I best hide this creation process? It looks stupid and it takes longer time

3条回答
  •  滥情空心
    2021-01-05 23:27

    try this code, it's work for me

     try
      SendMessage(Application.MainForm.ClientHandle,WM_SETREDRAW,0,0);
      FormChild:=TBaseChildForm.Create(application);
      FormChild.Caption:='Form '+IntToStr(n);
      FormChild.Show;
     finally
      SendMessage(Application.MainForm.ClientHandle,WM_SETREDRAW,1,0);
      RedrawWindow(Application.MainForm.ClientHandle, nil, 0, RDW_FRAME or RDW_INVALIDATE or   RDW_ALLCHILDREN or RDW_NOINTERNALPAINT);
     end;
    

提交回复
热议问题