ill upload a piccy if nessary but hopefully you will be able to follow.
I have a WPF interface where the user can add textboxes/textblocks as they find nessary, all textboxes/textblocks are already created but start in a Collapsed state until the User adds them and they become 'Visible'.
All these Collapsed elements are in Collapsed Group Boxes which are themselves in a single stackpanal.
One of these group boxes, in particular, has 8 Textboxes in it. Its highly unlikely the end user will use all 8 at the same time, Most people however will use 2-4 of the textboxes.
when a user adds 2 or 4 textboxes the groupBox containing them also becomes visable, the problem is the Groupbox is massive, as its size caters for 8 textboxes rather than 2 or 4.
Is it possible to compact the groupbox so its size is relative to how many textboxes are added by the user So the groupbox would be smaller if 2 or 4 textboxes are added and full size if the user adds all 8 for example?