how to: persist the DesktopBounds with a menu?  
Author Message
RobertHall





PostPosted: Sat Oct 09 18:31:19 CDT 2004 Top

Winforms >> how to: persist the DesktopBounds with a menu? 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

DotNet156  
 
 
Justin





PostPosted: Sat Oct 09 18:31:19 CDT 2004 Top

Winforms >> how to: persist the DesktopBounds with a menu? 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.

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"assaf" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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
>
>
>


 
 
assaf





PostPosted: Sat Oct 09 19:14:08 CDT 2004 Top

Winforms >> how to: persist the DesktopBounds with a menu? 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


"Justin Rogers" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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.
>
> --
> Justin Rogers
> DigiTec Web Consultants, LLC.
> Blog: http://weblogs.asp.net/justin_rogers
>
> "assaf" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > 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
> >
> >
> >
>
>