I've got a panel which will sometimes need more vertical screen space than naturally fits, so it needs to be able to vertically scroll. So, it's all set to AutoScroll.
The controls are contained within a TableLayoutPanel and set to dock, so they should resize their width to match. Yet, when the control triggers the scrollbar, it always ends up creating a horizontal scrollbar, even though there's no minimum width constraint on the control that's being violated. It's creating the horizontal scrollbar based on the previous width rather than respecting the dock command and redrawing the control to fit the new width.
Is there a better way round this?
Yes, that's an inevitable consequence from the way layout is calculated. Getting rid of the horizontal scrollbar would require multiple passes through the calculation but .NET only makes one pass. For a good reason, layout can be bi-stable, flipping back and forth between two states endlessly.
I don't really understand how a TableLayoutPanel would be useful here or what makes it grow. In general, just don't dock it, give it the size you want to fill the panel. Something like this perhaps:
Try this: