Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have 2 forms,form1 and form2. form1 is the main form and contains 3 buttons and 3 menustrip items.form 2 has been reference to form1 and contains 2 checkboxes.Checkbox1 when checked disable the buttons and menustrip items on form1 and checkbox2 when checked enable the buttons and menustrip items on form1.
i want to save the changes so that the next time i open the application after closing i should see the changes.
please how do i save the changes to the application using application settings in c#
Posted
Comments
[no name] 9-Apr-14 7:13am    
http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx
lukeer 9-Apr-14 7:20am    
The Properties.Settings.Default.Save(); part is important. Back then, trying to get this to work, I managed to ignore it for several hours.
Emre Ataseven 9-Apr-14 16:20pm    
Do you want to save properties of all controls of form? Or just for those u talked about?

1 solution

1.You should create properties for each checkbox that controls the user interface options; you could do this by adding/editing in Visual Studio the project properties.

2.On checkbox click event you should manage to change the property value and to save its state (true or false) into the application settings by using: Properties.Settings.Default.Save()

3.On from Loading event you should read the properties values (by using the same object: Properties.Settings.Default ) and enable or disable functionaries from your forms.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900