Hello!!!! Enybody out there???

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

  • 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.

Howdy, Stranger!

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

Categories

In this Discussion