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

C#: Resizing Window Applications at runtime?

Posted on 2004-10-07
3
231 Views
Last Modified: 2008-03-06
I like the way other windows programs allow the end user to click-n-drag the bottom-right corner and customize its size. This much I can do, however I would like any controls to resize accordingly to the window, for example, if there is a listview. Currently when I resize the window, the controls stay exactly in place.

Q. How do I setup my app to resize-all when an end user resizes the main window?
0
Comment
Question by:kvnsdr
  • 2
3 Comments
 
LVL 10

Expert Comment

by:smegghead
ID: 12248809
You can achieve this using the 'Anchor' property, in conjunction with splitter bars, and the 'Dock' property.

When you set the anchor property, it says that you are anchoring a side of the control to it's container.

So, if you have one listbox on your form anchored to each side, when you re-size your form, it will leave the same gaps between the control and it's container.

It gets quite complicated when you've got lots of controls on your form, but you can get around this by putting your controls in a group box, to keep them together, then docking or anchoring that group box.
0
 
LVL 10

Accepted Solution

by:
smegghead earned 250 total points
ID: 12451957
kvnsdr,

Did my comments help you ?? if not, feel free to request further info.

Smg.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

791 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