Henry Olive 5 Posted 12 hours ago Good Day, VCL In Form1 my button code = Form2.Show; and Form2 opens front, but when i click the Form1(which is behind the Form2) Form2 should move behind of Form1 but No, like my button code was Form2.ShowModal , what am doing wrong ? Thank You Share this post Link to post
Remy Lebeau 1392 Posted 10 hours ago (edited) 9 hours ago, Henry Olive said: when i click the Form1(which is behind the Form2) Form2 should move behind of Form1 but No, like my button code was Form2.ShowModal , what am doing wrong ? You are not doing anything wrong. By default, Form1 is simply becoming the parent window (in API terms, not VCL terms) for Form2, which is why Form2 can't move behind Form1. You can change this behavior by either: using Form2's PopupMode and PopupParent properties overriding Form2's virtual CreateParams() method to set TCreateParams.WndParent to either 0 or TApplication.Handle turning off TApplication.MainFormOnTaskBar, which has the (side) effect of making the TApplication window be the parent window for all Forms. Edited 3 hours ago by Remy Lebeau Share this post Link to post