Problems using


New member
May 15, 2014
Programming Experience
In my program when I open a new form, I new to do "show(this)" ir order to send the parent to the new form, to ensure it is open in the same display (when multi monitoring) with the instruction CenterToParent.

Thats run, but the problem is when I do it the new window is always in front of the parent window.

I give you here an application example, in which after load Form2 from Form1, form1 is always back to form2, although it has the focus.

Anyone knows how to solve it?

That's because that's exactly what you're telling it to do. By passing 'this' to Show, you are saying that the new form is owned by the existing one. An owned form will always appear in front of its owner and it will minimise, restore and close when it's owner does too. One option could be to set the Owner to 'null' as soon as the new form opens.
Top Bottom