There is GroupBox on the Form with below properties:
AutoSize = true;
AutoSizeMode = GrowAndShrink;
It seems, if you add Control into this GroupBox, the GroupBox's height will be:
Control.Top + Control.Height + 20;
Is there any way to decrease this number ---> 20
?
AutoSize = true
means that the control will start calling the GetPreferredSize(Size proposedSize)
method.
You can subclass GroupBox
and override the GetPreferredSize
method.