I wish to have a window whose width can be resized but not its height.
I tried this:

this.MaximumSize = new System.Drawing.Size(0, 300);
this.MinimumSize = new System.Drawing.Size(0, 300);

which according to the documentation on MaximumSize and MinimumSize should
accomplish what I want. The 0's are supposed to mean that only the system
limits
apply.

What is occurring is that the form appears with minimal width, the correct
height
and the form is not resizable in any direction.

Can anyone clear this up for me?

Regards
Chris Saunders

Re: Window size control by Jeff

Jeff
Mon Apr 10 06:38:07 CDT 2006

Why don't you try setting the MaximumSize 'x' property to something really
big instead (you can problem query for a "real" maximum), and see if that
changes things. The docs say that if you set *both* to 0, then you get the
system limits, but isn't specific about what happens if you set only one of
the values to 0.
- jp

"Chris Saunders" <evas@mountaincable.net> wrote in message
news:%23WfKRwIXGHA.5012@TK2MSFTNGP05.phx.gbl...
>I wish to have a window whose width can be resized but not its height.
> I tried this:
>
> this.MaximumSize = new System.Drawing.Size(0, 300);
> this.MinimumSize = new System.Drawing.Size(0, 300);
>
> which according to the documentation on MaximumSize and MinimumSize should
> accomplish what I want. The 0's are supposed to mean that only the system
> limits
> apply.
>
> What is occurring is that the form appears with minimal width, the correct
> height
> and the form is not resizable in any direction.
>
> Can anyone clear this up for me?
>
> Regards
> Chris Saunders
>



Re: Window size control by Chris

Chris
Mon Apr 10 07:27:25 CDT 2006

This was a mis-reading of the documentation on my part.
Thanks very much for the assistance Jeff - your suggestion works.

Regards
Chris Saunders

"Jeff Pek (Autodesk)" <jeff.pek@nospam.autodesk.com> wrote in message
news:O6u7ONJXGHA.5096@TK2MSFTNGP03.phx.gbl...
> Why don't you try setting the MaximumSize 'x' property to something really
> big instead (you can problem query for a "real" maximum), and see if that
> changes things. The docs say that if you set *both* to 0, then you get the
> system limits, but isn't specific about what happens if you set only one
> of the values to 0.
> - jp