I am creating a windows Form that has autosize set to true, and AutoSizeMode = GrowAndShrink.
I stuck a simple control onto the form and ran the program. The form correctly resizes to only show the one control.
I then added a strip to the bottom of the form (I started with a DevExpress Bar, but then just to only use native controls, I stuck a statusStrip down there).
When I run the application this time, the autosized form is exactly the same size as the one without the status bar, and the control that I added is overlapping the status bar (I can see that the status bar is still actually there).
Why is this the case? Is this intentional? I would expect that the form shrinking would respect the fact that a status bar on the bottom of a form should not be overlapped.
The AutoSize doesn’t work very well when the controls are docked, etc. Turn off the DockStyle on the StatusStrip to see the auto size work.
See Jared Par’s AutoSize and DockStyle.Fill don’t mix blog.