Solved

Resize controls on a form when the user maximizes the window

Posted on 2009-03-29
3
173 Views
Last Modified: 2013-11-27
Hello experts

I need to dynamically resize the controls on a form when the user clicks the maximize button.

I have found plenty of examples about how to do this sort of thing if the resolution changes but cn find nothing if it is just the size of the parent window that changes.
0
Comment
Question by:jindalee
3 Comments
 
LVL 9

Expert Comment

by:djon2003
ID: 24015334
Why don't you use the Resize event of the form ?

If the code has only to be executed on Maximised status, then look at WindowState property of the form.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24015369
You need to set the Anchor/Dock properties of your controls.  This will allow them to be resized as your form size changes.

See:
http://www.samspublishing.com/articles/article.asp?p=102148&seqNum=5
http://www.devx.com/dotnet/Article/6964/1954?pf=true
0
 
LVL 1

Author Closing Comment

by:jindalee
ID: 31564145
Sams publishing did the trick. So simple!
0

Featured Post

Free Trending Threat Insights Every Day

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

13 Experts available now in Live!

Get 1:1 Help Now