Results 1 to 6 of 6

Thread: Saving + Reloading A Completed Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2009
    Posts
    6

    Question 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

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Saving + Reloading A Completed Form


  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2009
    Posts
    6

    Re: Saving + Reloading A Completed Form

    Sorry but that link is very confusing

    Chris

  4. #4
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    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:
    1. Private Sub ButtonSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
    2.         My.Settings.Save() 'Saves those settings
    3.     End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2009
    Posts
    6

    Re: Saving + Reloading A Completed Form

    Excellent Much Appreciated

  6. #6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width