how to: persist the DesktopBounds with a menu?

  • Thread starter Thread starter assaf
  • Start date Start date
A

assaf

hi all

i have a form that i would like to persist its desktopbounds.
however, upon each shut down + start up of the application
and the form,
the form's bottom grows by about the size of a menu.

this is obviousely an unwanted effect.


how can i persist the desktop bounds of my form with the menu?


assaf
 
Generally you are trying to maintain the client area, not the actual size of the
application.
The client area is where all of the various controls are hosted and doesn't
include the
region used by menus, the various adornments of visual styles, etc... Taking and
restoring
the ClientSize in your appication should enable you to perform a consistent
reload without
having the enlarged size issues.

If you are still having issues, then we'll need more information. It is possible
you are attaching
your menu after you set the size. In which case you'll want to change your
ordering a bit.
 
hi justin.

your suggestion did not work for my code.

here is some more info:
i am adding the menu in the designer.
which means it gets called in the constructor.

i am setting the bounds after that,
but before the Load event.


assaf
 
Back
Top