Delphi - Hidden MDI child form creation

后端 未结 3 1258
无人及你
无人及你 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:21

    I had a similar problem with flickering MDI childs. I used combination of overrinding AfterConstruction and WM_SETREDRAW message from this tip: Controlling the placement of fsMDIChild windows in Delphi

    SendMessage(Application.MainForm.ClientHandle, WM_SETREDRAW, False, 0);
    try
      Child := TChildForm.Create(Self);
      Child.Left := ...;
      Child.Top := ...;
      Child.Show;
    finally
      SendMessage(Application.MainForm.ClientHandle, WM_SETREDRAW, True, 0);
      InvalidateRect(Application.MainForm.ClientHandle, nil, True);
    end;
    

    And everything works fine.

提交回复
热议问题