Window size control

  • Thread starter Thread starter Chris Saunders
  • Start date Start date
C

Chris Saunders

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
 
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
 
This was a mis-reading of the documentation on my part.
Thanks very much for the assistance Jeff - your suggestion works.

Regards
Chris Saunders
 
Back
Top