Jump to content
Ian Branch

Main form appears when i openn a sub-sub form. :-(

Recommended Posts

Hi Team,

Win 10, D10.4.  32 bit.

From my App main form, Form1, I open a sub-form, Form2, using TForm2.Create(nil).Show;

Whilst in the Form2 I may open a further sub-sub-form, Form3, from Form2 using TForm3.Create(nil).show;

When the Form3 opens the main form appears between Form2 & Form3. 😞

Is this an issue with D10.4?  I can't test previous versions anymore, my PC had a hardware meltdown and I had to reinstall everything, including the OS, from scratch. 😞  So I have only re-installed D10.4.

If it isn't specific to D10.4, is there a work around to stop the main form from showing?

I must confess, I don't understand why the main form is showing given as far as I know I haven't set any ownership by using ...Create(self).show.

Thoughts, suggestions, solutions, education welcome.

 

Regards & TIA,

Ian

Share this post


Link to post

How do you want the Forms to behave in relation to each other?  Do you want the MainForm to ever be able to appear on top of Form2?  If not, then set the MainForm as the PopupParent for Form2.  And set Form2 as the PopupParent for Form3, if you don't want Form2 to ever appear on top of Form3.  See this blog article: PopupMode and PopupParent.

Edited by Remy Lebeau

Share this post


Link to post

HI Remy,

So.  It was education. 😉

Never ever looked at or used PopupMode or PopupParent.

To confess, I re-read the reference and the relevant Delphi help several times and was still unsure exactly what it was telling me.

So, I experimented.  I have ended up with Forms 1, 2 & 3 all set with PopupMode set to pmAuto and that resolves my issue.

Not sure if that is technically correct, but it works for me.

Thank you for the pointer/education.

 

Regards,

Ian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×