I can't get out from my problem.
I have a panel with multiple controls and I want them be as large as the panel width.
These controls can be extended and collapsed by a clicking a button, showing or not some controls they contain.
So the I've set Dockstyle.Fill = true
for the panel.
The problem is: when I click for extending one of this controls, the scroll bar is showed (and it's ok) but it automatically cause a resize of the width of the controls in the panel and it is really bad looking and slow, because I have a lot of controls!!!
I have tried adding Padding and Margin to the panel, but with no result.
I have tried making a first panel where to put the controls with a fixed width less 40px (more than the size of the scrollbar) and a fixed height with Dockstyle.Fill = false
and then putting this first panel inside a parent panel with Dockstyle.Fill = true
, but with no result. The scrollbar doesn't show itself when I click for extending one control.
The following one should work (i'm working on it):
the panel should have Dockstyle.Fill = none
and when I click to extend or collpase the control I should also adjust the height of the panel (panel's height = heights' sum of all elements visibile in the panel)