Relative Resizing of Forms in .NET

Posted by xarzu on Stack Overflow See other posts from Stack Overflow or by xarzu
Published on 2010-04-19T00:19:59Z Indexed on 2010/04/19 0:33 UTC
Read the original article Hit count: 659

Filed under:
|
|

What is the magic that makes components cling to the edges of a form?

I had thought that one must use the resize event of the form and them force each element in the form to resize.

But then I saw some sample code which, even when I am editing the form, the elements seem to adhere to a percentage of the space they take up in the form rather than a set diminsion. In other words, when I am editing the form and resizing it, the panels and the parts inside the form bend their shape such that the edges remain a few pixels from the edges.

But in my own program I have not been able to find where I can duplicate this feature. When I run my program, this

alt text

goes to this

alt text

© Stack Overflow or respective owner

Related posts about c#

Related posts about winforms