By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 881 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Save data in TextBoxes when close Form

P: 8
Hi people.I have a problem and I will try to describe it.I have 5 forms in my Visual Basic application.First one is startup and other 4 forms are connected with first one.Also I have TextBoxes on all forms.I want to connect second form with fifth form, I mean I want to insert data in TextBoxes on second form and want that results of calculation will be showed in TextBoxes on fifth form, but when I close Second Form all data from TextBoxes of second form are erased.How to save them when close Second Form?
Dec 3 '13 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 9,731
I mainly work in WPF so my suggestion would be to use an Object that both pages are bound to.

Because both pages would be using the same object...if my object was a Person, and I changed they eye colour of that person on one page it would appear on the second page as well.

I'm not sure what you are currently doing to display the values on your "5th" page so I can't really help you much further.

Dec 4 '13 #2

P: 8
I want to diplay in TextBox on 5th form, a result of calculation using TextBoxes on form2...
Thanks in advance
Dec 7 '13 #3

Expert Mod 5K+
P: 9,731
Ok, what have you tried so far to accomplish that?

Did you consider creating an object for this purpose as I suggested previously?

Just to recap:
I suggested creating an object that would be used by both forms.

This object would be responsible for gathering information from the Second-Form and be responsible for "Doing Calculations".

This object would also be used in the Fifth-Form to display the calculations based on what was gathered in the Second-Form.

That way, when you close Second-Form (and all of your TextBoxes are destroyed) you will still have access to the information provided by the user in that form. As an added bonus, the object could actually have functionality that does calculations based on the data within it...that is the beauty of object oriented programming :)
Dec 9 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.