Mirror

How to hide MDI child forms (Views: 100)


Problem/Question/Abstract:

How to hide MDI child forms

Answer:

To hide:

{ ... }
if Form2.WindowState = wsMaximized then
  Form2.WindowState := wsNormal;
ShowWindow(Form2.Handle, SW_Hide);
{ ... }

To redisplay:

{ ... }
SetWindowPos(Form2.Handle, HWND_TOP, 0, 0, 0, 0, SWP_NoMove or
  SWP_NoSize or SWP_ShowWindow);
WinProcs.SetFocus(Form2.Handle);
{ ... }

<< Back to main page