Results 1 to 3 of 3

Thread: Saving data

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2011
    Posts
    4

    Saving data

    I have a text box wherein once you open the program, there's already a text in it and its enabled property is set to false.

    I have two command buttons. The function of the first one is that once you click it, then textbox.enabled=true which means you can edit it. The other one is that you can save the changes made in the text box then textbox.enabled=false. Once you open the program again, the one you typed on the textbox before clicking the 'save' command button will be the one to appear on the text box. Is it possible and if yes, what is the code? Thanks!

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Saving data

    Hi.. Welcome to the forums...

    To get back the previous value when you reopen the program, you need to save it to somewhere.

    The options are:
    • save to a file
    • save to registry
    • save to database

    You could select any one of the above mentioned methods.

    For the code, you have to search this forum as it has already been discussed several times on how to save in the above three ways.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Re: Saving data

    To save in the registry, the easiest way is like this:

    In form_unload write:
    SaveSetting(App.Name, "Settings", "MyValue_1", Me.txtValue.Text)


    In form_load write:
    Me.txtValue.Text = GetSetting(App.Name, "Settings", "MyValue_1")

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