Window size control

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
 
J

Jeff Pek \(Autodesk\)

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
 
C

Chris Saunders

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

Regards
Chris Saunders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top