Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2010, 02:03 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default Dynamic Resizing of Form Elements Relative to Form Shape in C#

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 (normal looking form/window) goes to this (expanded window/form with the components staying put when I want them to resize) when I click on the bottom right corner of the window and drag the mouse to resize.
 
Old April 19th, 2010, 09:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Did you try with anchor your controls to the form?? look at that property.. This happends to you also at design time??
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old April 28th, 2010, 07:41 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes, that worked.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing form dotnetprogrammer VS.NET 2002/2003 0 February 23rd, 2005 02:58 AM
Question on dynamic changes to other form elements savoym Javascript 1 October 27th, 2004 10:17 AM
Resizing of form view - problem lmadhavi Visual C++ 2 October 1st, 2004 06:18 AM
How to create a custom form shape lotfi BOOK: Professional C#, 2nd and 3rd Editions 0 November 15th, 2003 08:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.