C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Hello!!!! Enybody out there??? Posted by VGKing on 22 Oct 2009 at 4:37 PM
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 :)
Report
Re: Hello!!!! Enybody out there??? Posted by Xelalem on 13 Nov 2009 at 12:08 PM
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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.