Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My Windows Form keeps on shrinking/resizing on build

I am working on a Windows Forms project. It contains a tab controller with multiple pages and multiple controls on each.

It appears that relatively recently, after some form changes, that each time I build and run the solution the form resizes/shrinks.

So if I set the size of the form height to 768, once I click 'Start' to build and run it, I can actually catch a glimpse of it resizing itself during the process and then the form loads 21 pixels shorter than the height value it was at build for.

If I then keep building and running my project, the form will decrease by 21 pixels each time, making it smaller and smaller with every build.

We think it might have been introduced when we added the 'DataGridView' controller to one of the tabs, but we have yet to prove if that's the case.

Is there a reason why this would be happening, and what could be doing this? Why would it resize itself during build run time?

like image 671
Simon Avatar asked Dec 24 '14 07:12

Simon


People also ask

How do I stop windows from resizing a form?

First, select the form. Then, go to the properties menu. And change the property "FormBorderStyle" from sizable to Fixed3D or FixedSingle.

How do I make my windows form resizable?

By dragging either the right edge, bottom edge, or the corner, you can resize the form.

How do I fix winform size?

You can restrict the size of a form by setting it's MaximumSize and MinimumSize properties. This will help you control the maximum and minimum size the form can be resized to. Also note that WindowState property of the form plays a part in how the form can be resized.

Is it possible to resize a control within the form design window?

You can resize individual controls, and you can resize multiple controls of the same or different kind, such as Button and GroupBox controls.


1 Answers

  1. Copy the values of your form size.
  2. Past it in both Minimum and Maximum Size property.
  3. Enjoy
like image 115
zakir ullah Avatar answered Oct 10 '22 21:10

zakir ullah