Solved

C#: Resizing Window Applications at runtime?

Posted on 2004-10-07
3
227 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

16 Experts available now in Live!

Get 1:1 Help Now