[SOLVED] Center 2nd Form on Main Form lazarus / 10-Designer ---------------------------------------------------------------------- tudi_x · 2016-12-05 14:59 Hi! I am using the poMainFormCenter option in Lazarus 1.6.2 32b on Windows 7 64b when creating a second form as per attached project. Unfortunately the second form is not centered to the main form and shows as per attached. Please advise what I am missing. Thank you! ---------------------------------------------------------------------- mig-31 · 2016-12-05 15:12 Hi, remove it Form2 from autocreate Form list. Add code for example to TButton.Onclick: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  AForm2:TForm2;begin  AForm2:=TForm2.Create(Self); end; ---------------------------------------------------------------------- tudi_x · 2016-12-05 16:02 Thank you, the form is centered when there is no method on the On Show event. If I assign a method to the On Show event the second form does not center the main, regardless where the poMainFormCenter option is set, in code or Object Inspector. Code with method is attached. Please advise. ---------------------------------------------------------------------- davect · 2016-12-05 16:24 Use poOwnerFormCenter instead of poMainFormCenter. ---------------------------------------------------------------------- tudi_x · 2016-12-05 19:25 Thank you. It worked with poOwnerFormCenter, although with some tweaks in some code (ex. use Screen Center in Object Inspector and Owner Form Center in code) and directly in other code.