Hello!!!! Enybody out there??? - Programmers Heaven

Howdy, Stranger!

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

Categories

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.