Click to See Complete Forum and Search --> : [RESOLVED] Font Dialog
Romeo
Apr 4th, 2007, 06:09 AM
Hello Guys,
I'm busy with making an application for school.
My question is how can i store the settings of the fontdialog? I want that next time load the last configuration I set before.
it is like a simple text editor. I put here a picture for better understanding.
Any advice is welcome
Thank you very much
jmcilhinney
Apr 4th, 2007, 07:00 AM
Use application settings to persist values from session to session. Add settings to the Settings tab of the project properties and then access them in code via Properties.Settings.
Romeo
Apr 5th, 2007, 03:33 AM
Ok i understood but how can i manipulate that settings from a form ?
I tried this it gaves an error its readnonly
Properties.Settings.Default.CFOnt = fd.Font;
thanks
jmcilhinney
Apr 5th, 2007, 03:45 AM
Settings with Application scope are read-only. Only settings with User scope can edited through Properties.Settings. To edit settings with Application scope you must use the members of the System.Configuration namespace, specifically the Configuration and ConfigurationManager classes. See the MSDN help topic for the ConfigurationManager.OpenExeConfiguration method for an example.
The reason for this is that user settings are stored under each user's own Application Data folder, which each each user always has access to. Application settings are stored in the program folder under the Program Files folder. Only administrators have access to that folder so you should check whether the current user is an administrator before attempting to edit application settings.
Romeo
Apr 5th, 2007, 04:31 AM
Ok thank you very much for your information i used user user scope for it now i can change the value also.
Thanks again
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.