Solved

How do I make parent forms resize according to its fixed-size controls in VB.NET?

Posted on 2012-03-27
3
456 Views
Last Modified: 2012-03-28
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?
0
Comment
Question by:andreas_rafn
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 400 total points
ID: 37774200
The only way I know of would be to manually adjust the size of different containers and form based on size of the added control. Its easier to adjust the controls based on form size using anchor and dock properties but I am not aware of a way of doing it vice versa easily.
0
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 100 total points
ID: 37774423
Agreed.  You'd have to manually code the containers to grow to accommodate the newly added control.
0
 

Author Closing Comment

by:andreas_rafn
ID: 37779665
Thanks for the input. In light of that I've decided to rethink and redesign the layout so that no automatic increase of size is needed, which is probably a better solution.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 50
listing all functions in JavaScript 19 112
Round up to 100% in .NET 10 45
Visual Studio editor? 1 16
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now