Results 1 to 4 of 4

Thread: Save last font ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Save last font ?

    Hello,

    I am using the streamWriter/streamReader to save my last settings to a text file and then load from the text file on startup. How do I save the last font settings and recall them from the text file?

    I am doing this (below) to save the font info:

    sw.WriteLine(myFont.ToString());

    ...but I am not sure if this is what I should be doing OR how to load it back in as my font using the streamReader.

    Thanks!

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

    Re: Save last font ?

    Are you using VS 2005? If so then don't use a text file. Use the in-built application settings functionality. Also, please specify your version when creating a thread. You must have seen the radio buttons created expressly for that purpose by now.
    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
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Save last font ?

    Thanks. I am using Visual Studio.NET 2003....and no...I did not notice the version radio buttons. None of the ones I saw said 2005 or 2003.... but I see what you mean (I think).

    I don't have the settings option in 2003. While searching for a solution to this I did see that 2005 has that feature....which is very nice. But....since I do not have that option...what do you suggest?

    Thanks!

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Save last font ?

    Hello again...

    When I load my application, I am setting "myFont" to:

    myFont = new Font("NATURALBORN" , 14 , FontStyle.Bold);

    Now what I would like to do is "read" my font from a text file. Something like this:

    The text saved to my text file (myFont.ToString()) = ...

    [Font: Name=NATURALBORN, Size=14, Units=3, GdiCharSet=1, GdiVerticalFont=False]

    So I need to do something like...

    myFont = new Font(sr.readLine());

    Obviously, that will not work unless I parse it out some how. How?

    Thanks!

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