I have a GroupBox
, and inside that GroupBox
is a Panel
with properties:
.AutoSize = false
.AutoScroll = true
.Dock = Fill
.AutoSizeMode = GrowAndShrink
I create controls in that (Scroll)Panel at runtime and I can also delete those at runtime. Those controls are again GroupBoxes
and those can expand/collapse when the user clicks on a button.
The problem is, that now during runtime I get dead space where no control is and I have no idea why. When the resizing from my GroupBoxes inside the Panel happens something goes wrong and now the Panel's ScrollBar can scroll far more up (where no control is anymore).
Does anybody know why this happens and how I can prevent my Panel to have a Scroll-Bar bigger than the actual scrollable content?
Thanks in advance