How do I make parent forms resize according to its fixed-size controls in VB.NET?
Posted on 2012-03-27
I'm building an application in which multiple UserControls are nested within each other as well the main form of the application.
I want the application form to have an initial size set (which is no problem). However whenever a UserControl with dimensions that cannot fit the content panel its added, all parent forms/usercontrols should resize (grow) to accommodate this "large" control. Optimally I would like to implement this behavior by setting control properties in the VS2010 designer if possible.
I have tried fiddling with AutoSize as well code triggered when controls are added that adjusts the parent control to the size of the child control added, but I can't seem to make it work.
What is the best way to implement the above functionality, and what do I miss, since it wont work?