|
-
February 17th, 2006, 01:03 PM
#1
Maintain data between Forms
Hi
I have one main Form1 which contains a button that call ShowDialog () to show a new Form2. In this new Form2 I have a Label, a Textbox and a Button. I write something in Textbox and that is copied in the Label after I push the Button. When I close the Form2 and reopen it, the text in Label has been lost (of course). The more simple solution is to store the text in a static string and Load it in Label when Form2 loads.
Is this the best way to maintain data between forms, by using static fields?
If I have more complex Controls like a TreeView I must save and store all the data in static variables?
Is there any other way to handle it? (it would be great if a .NET class can handle this automatically)
Thanks!!!!!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|