-
2 Attachment(s)
[RESOLVED] Font Dialog
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
-
Re: Font Dialog
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.
-
1 Attachment(s)
Re: Font Dialog
Ok i understood but how can i manipulate that settings from a form ?
I tried this it gaves an error its readnonly
Code:
Properties.Settings.Default.CFOnt = fd.Font;
thanks
-
Re: Font Dialog
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.
-
Re: Font Dialog
Ok thank you very much for your information i used user user scope for it now i can change the value also.
Thanks again