Use the ShowWindow function instead:
To hide:
procedure T_mdi_child_form.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
//this resolves problem with maximized MDI active form close
if Self.WindowState = wsMaximized then Self.WindowState := wsNormal ;
Action := caNone;
ShowWindow(self.WindowHandle, SW_HIDE);
end;
To show:
procedure T_mdi_child_form._action_show_Execute(Sender: TObject);
begin
inherited;
if _mdi_child_form = Nil then
Application.CreateForm(T_mdi_child_form, _mdi_child_form);
ShowWindow(_mdi_child_form.Handle, SW_SHOW);
_mdi_child_form.BringToFront ;
end;
To hide:
procedure T_mdi_child_form.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
//this resolves problem with maximized MDI active form close
if Self.WindowState = wsMaximized then Self.WindowState := wsNormal ;
Action := caNone;
ShowWindow(self.WindowHandle, SW_HIDE);
end;
To show:
procedure T_mdi_child_form._action_show_Execute(Sender: TObject);
begin
inherited;
if _mdi_child_form = Nil then
Application.CreateForm(T_mdi_child_form, _mdi_child_form);
ShowWindow(_mdi_child_form.Handle, SW_SHOW);
_mdi_child_form.BringToFront ;
end;
No comments:
Post a Comment