Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Resize controls on a form when the user maximizes the window

Posted on 2009-03-29
3
181 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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…

856 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