Reputation: 1
I have 2 forms: form1 and form2.
Form 1 has text boxes and domain up menus asking the user to enter personal information about him/her self, e.g Age, race and form 2 also.
The problem is when going from form1
to form2
, and then suddenly the user remembered he/she want to go back to form1
to correct some information, so for this I used a previous button that takes from form2
to form1
, but once going back to form1 it is initialized as if the user didn't enter anything.
the question is how do I move button forms back and forth without the textboxes and domainupdown menus losing their information, and no need for the user to reenter the information again. I use Hide()
but still the problem exists.
Upvotes: 0
Views: 1427
Reputation: 8201
You could do something more flexibile, like having those screens populated from an object, which is empty when first accesed, but when switching to screen 2, you take those values from textboxes and put them into the object, and then when you reopen the screen 1 you again populate the textboxes from the object but this time the object isn't empty, so you have your data; and you repeat the process - I hope you get the point.
Upvotes: 1
Reputation: 887215
You need to Show()
the existing instance of the first form, without creating a new instance.
Upvotes: 1