|
-
Aug 7th, 2009, 11:17 AM
#1
Thread Starter
New Member
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
-
Aug 7th, 2009, 11:18 AM
#2
Re: Saving + Reloading A Completed Form
-
Aug 7th, 2009, 11:28 AM
#3
Thread Starter
New Member
Re: Saving + Reloading A Completed Form
Sorry but that link is very confusing
Chris
-
Aug 7th, 2009, 11:47 AM
#4
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
-
Aug 7th, 2009, 12:19 PM
#5
Thread Starter
New Member
Re: Saving + Reloading A Completed Form
Excellent Much Appreciated
-
Aug 7th, 2009, 01:23 PM
#6
Fanatic Member
Re: Saving + Reloading A Completed Form
Mark this as Resolved by pressing it in tools or going to this link.
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
|