Saving + Reloading A Completed Form
Hi,
I am currently trying to create an expenses calculator, the sort that includes all your monthly outgoings and give you a total.
I would like to be able to fill the form in the save it + reload it when i run the program again, what is the best way to do this ?
Regards
Chris
Re: Saving + Reloading A Completed Form
Re: Saving + Reloading A Completed Form
Sorry but that link is very confusing
Chris
Re: Saving + Reloading A Completed Form
Here's an extremely simplified version of what you could do, this is PropertyBinding:
1) Create a new windowsapplication project
2) Add a TextBox onto your form
3) Go to the TextBox properties. Search for something called (ApplicationSettings)
4) Expand the (ApplicationSettings) property and look for the (PropertyBinding) property.
5) Click the (PropertyBinding) property then click the button with an ellipsis on it (...)
6) A new window will come up called Application Settings for 'TextBox1'
7) Search for the property that says Text and click it, then click the dropdown arrow.
8) A little window pops up, click New...
9) Another window pops up. In the Name property put TextBox1Value (or whatever you want to call it)
10) Click Ok, then OK on the other window.
11) If you look at the (PropertyBinding) property, under it you will see Text | TheValueYouEnteredIn step 9
12) Run the application
13) type something into the textbox
14) close the application
15) re-run the application, your text is still there
Congratulations, you just completed PropertyBinding the TextBox.Text value to a setting. Go to My Project > Settings to see these settings.
To optionally save these types of settings go to My Project > Application and look for the checkbox that says "Save My.Settings on Shutdown". If you want to create a save button then uncheck that box and drag a button on to your form. On it's MouseClick event put this line of code:
vb.net Code:
Private Sub ButtonSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
My.Settings.Save() 'Saves those settings
End Sub
Re: Saving + Reloading A Completed Form
Excellent Much Appreciated :)
Re: Saving + Reloading A Completed Form
Mark this as Resolved by pressing it in tools or going to this link.