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 HobbsPosted Jul 23, 2010, 12:01 PM
Sam HobbsPosted Aug 3, 2010, 6:07 PM
CherRon McLemorePosted Aug 3, 2010, 9:27 AM
Sam HobbsPosted Jul 27, 2010, 5:46 PM
DamodarPosted Jul 27, 2010, 4:34 PM
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.
DamodarPosted Jul 27, 2010, 10:34 AM
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.
Donald RamseyPosted Jul 23, 2010, 1:50 PM
How To Use the Settings Class in C#
http://www.codeproject.com/KB/cs/PropertiesSettings.aspxChris RileyPosted Jul 23, 2010, 12:13 PM
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
DamodarPosted Jul 23, 2010, 9:34 AM
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 ?
Sam HobbsPosted Jul 23, 2010, 1:39 AM
Kirtan PatelPosted Jul 22, 2010, 3:55 PM