Restoring font/form size at run time problem - help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VGVycnk=?=

    Restoring font/form size at run time problem - help!

    Hope someone has some ideas - this is driving me nuts,
    I am using VS2008 and have a tightly layed out form at 8 pts. The form
    has a font dialog and when the user changes the font size, everything works
    great. I go through the forms control collection (recurively) and everything
    resizes as it should.
    Ok, so the next step is to remember the font size selected by the user
    and select it when the form is loaded. Woops - does not work! So, I try to
    do it 'earlier' in a Sub New() and it still does not work. I try it later,
    in the Activated event and same problem, the form never resizes. So all the
    controls have the new (larger) font, but the form (and the controls in it)
    have not resized!
    Ok, so I think, well I will also have to set the form size myself. This
    almost works!
    Some parts grow as they should, some grow more then they should and some
    don't grow at all!
    So, if the user is able to select a font, and it works, how do I
    duplicate that when the user starts up the application again? Is there some
    place besides New/Load/Activated that I should be doing this from?

    TIA,
    --
    Terry
  • rowe_newsgroups

    #2
    Re: Restoring font/form size at run time problem - help!

    On Mar 25, 1:10 pm, Terry <Ter...@nospam. nospamwrote:
    Hope someone has some ideas - this is driving me nuts,
    I am using VS2008 and have a tightly layed out form at 8 pts. The form
    has a font dialog and when the user changes the font size, everything works
    great. I go through the forms control collection (recurively) and everything
    resizes as it should.
    Ok, so the next step is to remember the font size selected by the user
    and select it when the form is loaded. Woops - does not work! So, I try to
    do it 'earlier' in a Sub New() and it still does not work. I try it later,
    in the Activated event and same problem, the form never resizes. So all the
    controls have the new (larger) font, but the form (and the controls in it)
    have not resized!
    Ok, so I think, well I will also have to set the form size myself. This
    almost works!
    Some parts grow as they should, some grow more then they should and some
    don't grow at all!
    So, if the user is able to select a font, and it works, how do I
    duplicate that when the user starts up the application again? Is there some
    place besides New/Load/Activated that I should be doing this from?
    >
    TIA,
    --
    Terry
    Is your restore font size method different than the one you are using
    to change the font size when the user changes it? Ideally, the restore
    should be just retrieving a font value from a data store (.config,
    registry, seperate xml, etc) and then running the same method you use
    when the users changes the font size.

    Thanks,

    Seth Rowe [MVP]

    Comment

    • =?Utf-8?B?VGVycnk=?=

      #3
      RE: Restoring font/form size at run time problem - help!

      Never Mind - I got it!

      Been looking at TableLayoutPane ls inside TableLayoutPane ls inside panels
      inside splitergroups etc until I am blue in the face! I found my problem and
      it all works fine, sorry for wasting anyones time.
      --
      Terry


      "Terry" wrote:
      Hope someone has some ideas - this is driving me nuts,
      I am using VS2008 and have a tightly layed out form at 8 pts. The form
      has a font dialog and when the user changes the font size, everything works
      great. I go through the forms control collection (recurively) and everything
      resizes as it should.
      Ok, so the next step is to remember the font size selected by the user
      and select it when the form is loaded. Woops - does not work! So, I try to
      do it 'earlier' in a Sub New() and it still does not work. I try it later,
      in the Activated event and same problem, the form never resizes. So all the
      controls have the new (larger) font, but the form (and the controls in it)
      have not resized!
      Ok, so I think, well I will also have to set the form size myself. This
      almost works!
      Some parts grow as they should, some grow more then they should and some
      don't grow at all!
      So, if the user is able to select a font, and it works, how do I
      duplicate that when the user starts up the application again? Is there some
      place besides New/Load/Activated that I should be doing this from?
      >
      TIA,
      --
      Terry

      Comment

      Working...