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?
First, select the form. Then, go to the properties menu. And change the property "FormBorderStyle" from sizable to Fixed3D or FixedSingle.
By dragging either the right edge, bottom edge, or the corner, you can resize the form.
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.
You can resize individual controls, and you can resize multiple controls of the same or different kind, such as Button and GroupBox controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With