Hi all,
I have developed a Windows form with 7 tabs. Each tab has some check boxes, radio buttons and labels.
Now when I make changes and close the application, when I reopen it again I want the application to remember the changes that have been done prior on it i.e what check boxes, radio buttons have been checked.
What is the best way to do this? I was planning to write a Xml file and then make changes to that. Is there any other way or better way to do this ?
If there is some sample code that would be appreciated.
Loading

Sam HobbsRank #107 · 20.5K reputationPosted Jul 23, 2010, 8:01 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Jul 22, 2010, 11:55 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Jul 22, 2010, 9:39 PM EDT
Damodar29 reputationPosted Jul 23, 2010, 5:34 AM EDT
Very little is to be stored or saved. It is just a matter of 5 Check Boxes and 4 Radio buttons. So, max it would be around 4 checkboxes and 1 Radio button that it should remember.
I am not at all familiar with application properties. I have seen the Settings.Designer.cs file in properties. What should I do there ?
Chris Riley33 reputationPosted Jul 23, 2010, 8:13 AM EDT
put de changes in de box
close de box
selotape de box
put xml sticker on de box
the box is allll goood
no to load changes from de box
open de box
and pour box content back into tabs
saaaaaawwwwwted
http://msdn.microsoft.com/en-us/library/182eeyhh(VS.80).aspx
Donald Ramsey7 reputationPosted Jul 23, 2010, 9:50 AM EDT
How To Use the Settings Class in C#
http://www.codeproject.com/KB/cs/PropertiesSettings.aspxDamodar29 reputationPosted Jul 27, 2010, 6:34 AM EDT
Thank you very much for the settings class. I am not able to understand which value I have to give.
I am doing like this
Name Type Scope Value
CheckBox1 System.Windows.Forms.CheckBox User ???
Now about retrieving the values. Where do I write the code to retrieve the values last saved when I reopen the application.
Please help me in this regard. Thanks a lot for your support.
Damodar29 reputationPosted Jul 27, 2010, 12:34 PM EDT
I put the type as bool and the default values of all the checkboxes as false. In the event for each checkbox i wrote this code
Form1.Properties.Settings.Default.CheckBox1 = true;
Form1.Properties.Settings.Default.Save();
And then in the public Form1() I wrote this to bring up the previously saved values.
checkBox1.checked = Form1.Properties.Settings.Default.CheckBox1;
Thank you all for ur help. You made my task easy.
Sam HobbsRank #107 · 20.5K reputationPosted Jul 27, 2010, 1:46 PM EDT
CherRon McLemore32 reputationPosted Aug 3, 2010, 5:27 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Aug 3, 2010, 2:07 PM EDT