Open forms change size when closing another

Asked

Viewed 78 times

1

Have forms of the kind fsMDIChild that are set to start maximized (wsMaximized). They open normally, however when I close some of them the others change their state to WsNormal.

I wonder if there’s any way to avoid it, even if it’s forced so the size doesn’t change.

Code of insertion of the Forms:

  if not Assigned(frmfornecedor) then
  begin
     frmfornecedor := tfrmfornecedor.create(frmPrincipal);
  end;

At the event OnClose of the Forms there is only one Close and nothing more.

  • I couldn’t reproduce this problem here. These forms are created in Runtime?

  • Yes friend, they are Runtime

  • You can edit the question and put how you are creating these images?

  • I added, see if it helps.

1 answer

1


This must have been caused by some change in the properties of the form FrmFornecedor because I could not reproduce this problem, check the property AutoSize is marked as False.

At the event OnClose() form FrmFornecedor instead of using Close, use:

procedure TFrmFornecedor.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
  • The problem was at the same Formclose event, however in addition to Action := caFree I added the receiver := nil; Thank you very much friend, this solved my problem :D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.