Quote:
I want to have a situation where there can be a maximum of 8 groupboxes in the form, but if they are not all needed, less will be shown.
I have done almost this exact same thing, and I actually ended up making almost exactly what JeffS suggested in his fourth post. I had a line class that contained all the controls for one line, and did all the internal formatting for that line. I had another class that contained in arraylist of line classes, and handled the (minor) formatting between lines. Each instance of the line keeps track of the controls of that line, adding them on the constructor and removing them when requested (since you can't rely on the destructor in DotNet.) It's fairly easy to do this way, the only hard part in my case was lines could add or remove the line below them, which required a lot of message passing which shouldn't be an issue for you.
_________________________
Ninti - MK IIa 60GB Smoke, 30GB, 10GB