all groups > dotnet compact framework > may 2004 >
You're in the

dotnet compact framework

group:

Calling another form, close the opener


Calling another form, close the opener Diego Rio
5/2/2004 10:31:02 PM
dotnet compact framework: 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

Re: Calling another form, close the opener Chris Tacke, eMVP
5/3/2004 7:36:52 AM
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

[quoted text, click to view]
Form2.Show(); but I need to close Form1 while maintaninig its data in
memory. How can i achieve this?
[quoted text, click to view]

Re: Calling another form, close the opener James McCutcheon
5/3/2004 6:54:06 PM
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

[quoted text, click to view]
Form2.Show(); but I need to close Form1 while maintaninig its data in
memory. How can i achieve this?
[quoted text, click to view]

AddThis Social Bookmark Button