0

I have a C# project and trying to open a child form (form3) from another child form (form2) but form2 goes aways behind to the parent's (form1) objects.

As you can see, when I open my form2, it hides the form1 objects: enter image description here

But when I click in the button1 and open the form3 and close the form2, form3 goes behind the form1 objects: enter image description here

What should I do to solve this problem? Form3 should also hide form1 objects!

These are my code lines from button1 in form2:

FormConsultaNome form = new FormConsultaNome();

Form1 form1 = new Form1();

form.MdiParent = Form1.ActiveForm;

form.Show();

this.Close();
Rob
  • 2,243
  • 4
  • 29
  • 40
  • in your sample code you are opening a form1, not a form3 like you said at the beginning – Homerothompson Oct 18 '17 at 16:26
  • Sorry! FormConsultaNome is my form3. The line "form1 form1 = new form1" i was using in a test, but i'm opening the form3 that is just named form in the sample. – Caio Almeida Oct 18 '17 at 23:17
  • Possible duplicate of [What is the "right" way to bring a Windows Forms Application to the foreground?](https://stackoverflow.com/questions/1463417/what-is-the-right-way-to-bring-a-windows-forms-application-to-the-foreground) – Homerothompson Oct 19 '17 at 12:06

0 Answers0