views:

52

answers:

1

Hello.

I have a form that has a panel in it. I've set the panel anchor and it works great, when I resize the form the panels height is increased.

The problem is: I've got several group boxes in the panel, and when the panel's height is increased, the group box vertical spacing should be increased equally.

How can I do that?

+6  A: 

Use a TableLayoutPanel and make sure the rows in it are all set to a size mode of "AutoSize". Next, make sure that your boxes you place in the table have a the "Dock" property set to one of the fill modes.

Pete
I've just done exactly what you say. Now when the TableLayoutPanel scroll disapear, the last groupbox starts to increase its heigth. After I set it's max size, the TableLayoutPanel heigth is increase, but every group keeps it's size and position.
Diego
And you would prefer the extra space get used to add spacing *between* the boxes instead?
Pete
Yes, that's right
Diego