0

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?

Anant Dabhi
  • 10,864
  • 3
  • 31
  • 49
Tim
  • 459
  • 1
  • 4
  • 20

1 Answers1

3

AutoSize = true means that the control will start calling the GetPreferredSize(Size proposedSize) method.

You can subclass GroupBox and override the GetPreferredSize method.

Loathing
  • 5,109
  • 3
  • 24
  • 35