"timtos" <ti****@gmx.de> wrote in message
news:bi***********@news.uni-koblenz.de...
But if the user makes the form smaller it would be nice if he
can push the maximize button to get it back to 300x300 pixels
- and have it again centered on the screen.
Of course I can create my own button which does the job
but I think it is more intuitive to use the windows-style...
I don't know if that's more intuitive or not. Generally, that button means
"maximize this window so it fills the screen" and I can't think of the last
time I saw that button do anything other than that. And how do you know the
user wants the location to be the middle of the screen? They might want it
at full size (300x300), but in the lower right corner of the screen.
I guess I'm not a big fan of "maximum size" to begin with - can't think of
any problems it solves (in contrast to minimum size which is very nice to
keep controls from overlapping each other). I'd either go with a fixed size
form, or else let the user size it however they want, and let them put it
where they want. That's most consistent with windows behavior.
I suppose you can watch the Resize event, check for WindowState = Maximized,
and then programmaticly unmaximize and set the location, but I think that
will end up causing about 10 other problems, especially when they try to
"unmaximize".
--
Mike Mayer
http://www.mag37.com/csharp/ mi**@mag37.com