Results 1 to 5 of 5

Thread: [RESOLVED] Font Dialog

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    Resolved [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
    Attached Images Attached Images   

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    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
    Attached Images Attached Images  

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    30

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width