Calling another form, close the opener

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms on my application. Calling the Form2 is a no brainer with Form2.Show(); but I need to close Form1 while maintaninig its data in memory. How can i achieve this

Diego Rio
 
Diego,

If you close a form all its "data" or objects are released. You can hide the
form and still access the data/objects on the form by passing a reference of
it to the second form. eg

in frmForm1:

frmForm2 Form2 = new frmForm2(this);
Form2.Show();

in frmForm2:

public frmFrom2(frnForm1 myCallingForm)
{
etc
}

--
James McCutcheon
Blog: http://www.j3technology.com/blog

Diego Rio said:
I have two forms on my application. Calling the Form2 is a no brainer with
Form2.Show(); but I need to close Form1 while maintaninig its data in
memory. How can i achieve this?
 
You can't close it and keep it's data. Try just hiding it or pass the data
to the new form before closing.

-Chris

Diego Rio said:
I have two forms on my application. Calling the Form2 is a no brainer with
Form2.Show(); but I need to close Form1 while maintaninig its data in
memory. How can i achieve this?
 
Back
Top