Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Hello!!!! Enybody out there???

VGKingVGKing Posts: 18Member
Hey everyone,

Im have a small newbie problem.

I finished my program and its all ready to go but, then I realized I have to make it so the user can save their progress, Duh, this program would be useless otherwise, I have Many textboxes, a few pictureboxes,
comboboxes, and numericUpDowns, how do i make it so the user can save the changes.


any advise on this topic is more than welcome

Thank You :)

Comments

  • XelalemXelalem Posts: 2Member
    you can save each data in the textboxes to a text file and loads it again when the appilication loads. something like this... when you should include


    using System.IO;


    //user closes the application


    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
    File.WriteAllText("c:\data1.txt",textBox1.Text);
    File.WriteAllText("c:\data2.txt",textBox2.Text);
    ...

    }

    // when the user opens the application

    private void Form1_Load(object sender, EventArgs e)
    {
    textBox1.Text= File.ReadAllText("c:\data1.Text");
    ....
    }

    //Hope this helps
Sign In or Register to comment.