4
Answers

Open Form1 as new instance after successful operations on Fo

Devi

Devi

8y
322
1
I am having two forms as Form1 and Form2 on Form1 button click I am opening the form2 as follows
 
private Form2 form2; this.Hide(); form2.ShowDialog(); this.Show();

I have a back button and submit button on Form2 when I click on Back this is how I am showing Form1

this.Hide(); this.DialogResult = DialogResult.OK;

But when I submit the form I need to load the Form1 with new instance, this is what I tried but Form1 is showing multiple times

if (DialogResult.OK == MessageBox.Show("Installation was done", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information)) { Form f1 = new Form ();    f1.Show(); this.Close(); }
Can some one help me

Answers (4)