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

T

Terry

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,
 
R

rowe_newsgroups

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,

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]
 
T

Terry

Never Mind - I got it!

Been looking at TableLayoutPanels inside TableLayoutPanels 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top