Why can't I set my form to a smaller height/width?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I would like to make very small on load. No matter how
small I set it the form gets set to 123x34 when it loads. I am free to
resize it smaller using my mouse but the initial size is still bigger than I
have set in my code, in this case 30x20.

Am I just stuck on this?

TIA
 
Try setting the Bounds (rectangle) property before setting the MinimumSize
and instead of setting Size.

i.e.:
control.Bounds = new Rectangle(control.Bounds.Location , new Size(30,20));
control.MinimumSize = control.Bounds.Size;
 
Try setting the Bounds (rectangle) property before setting the MinimumSize
and instead of setting Size.

i.e.:
control.Bounds = new Rectangle(control.Bounds.Location , new Size(30,20));
control.MinimumSize = control.Bounds.Size;

This didn't work. I stepped through my code line by line and set
every place that addressed the size of the window to 30x20 and it
still won't go smaller.
 
I have a form that I would like to make very small on load. No matter how
small I set it the form gets set to 123x34 when it loads. I am free to
resize it smaller using my mouse but the initial size is still bigger than I
have set in my code, in this case 30x20.

Am I just stuck on this?

TIA

I've solved the problem. The issue is with the border. If I change
the border to none I can make it as small as I want.
 

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

Back
Top