Multiple form help.

I have two forms. The first form opens up the second form like this.

 

this.Visible = false;

Form2 myForm2 = new Form2()

Form2.ShowDialog();

 

At some point in my application I want Form2 to close and make Form1 Visible again. How can I do this from Form2 I know how to close the form. It's a matter of making Form1 visible again.

 

Thanks for your help in advance.




Answer this question

Multiple form help.

  • jefswy

    Hi,

    Since you are using ShowDialog, Form will load as a Modal Form which means that anything which write after the call to ShowDialog will not be executed until Form2 is closed. So the following code will work fine:

    this.Visible = false;

    Form2 myForm2 = new Form2();

    myForm2.ShowDialog();

    this.Visible = true;

    Regards,

    Vikram

     



  • C#2006

    Thank you very much vikram

  • Multiple form help.