I have an application that works as follows: There is a main form and I open "child" forms during execution, for registration, search, etc. The intent is always to open the child forms in the center of the main form, regardless of the size of the form. To do this I use the following procedure (in the onCreate of the child form):
formulario->Left=(formPrincipal->pnlPrincipal->Width/2);
formulario->Top=(formPrincipal->pnlPrincipal->Height/2)-(formulario->Height/2);
So far right, the form is centered correctly, as shown in the following image:
Whenyouclosethechildform,restoretheparentform,andthenreopenthechildform,thefollowingproblemoccurs:
The child form is generated in the position that was generated the first time (with the maximized window).