I have a winform with a picture box, a button, and a menustrip. The picture box is anchored to all sides so when I resize the form, the picture box resizes as well. I set the form to have a minimum size of 700x600.
But this only works when the form is set to AutoSizeMode = GrowOnly. If I change to AutoSizeMode = GrowAndShrink, the diagonal <=> resize arrow doesn't even show up.
If I set the SizeGripStyle = Show on the form, I can get the arrow to show up and "resize" but as I drag it to resize, it just flickers really fast and goes back to default size.
How can I make it GrowAndShrink instead of just GrowOnly?
Make sure the form properties have the following:
AutoSize: false (sounds like it should be true, but set this to false).
AutoSizeMode: GrowOnly (like above, sounds like it should be GrowAndShrink)
MinimumSize: Not important. set to 1, 1 for now. Is just to stop resizing getting too small.
MaximumSize: Not important. set to 1, 1. As above (MinimumSize).
SizeGripStyle: Not important. Set to Show.
Lastly, ensure that you use anchoring or docking for adjusting control widths when the form resizes. Setting controls with a width may prevent you resizing the form.
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