Solved

Is there an easy way to resize forms?

Posted on 2003-11-19
10
514 Views
Last Modified: 2010-04-16
Is there an easier way to resize forms than changing all the controls locations and sizes by hand?  I have many forms and I would like to be able to resize, but all of these forms have many controls on them.  It seems like there might be an easier solution than modifying all the sizes/locations manually based on the new window size.  
0
Comment
Question by:jjacksn
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:AJMartin
ID: 9777298
> Is there an easier way to resize forms than changing all the controls locations and sizes by hand?

Yes. :)

Use an automatic layout manager. I use this free one from here:
http://9mm.com/~ogl/packnet/
and found it to be quite good. One does need to do a bit of work on one's objects though to specify minimum sizes for objects on the form.

There are other layout managers, including one on SourceForge, but I haven't used them. You could try experimenting with them if the above layout manager doesn't suit you.
0
 
LVL 1

Expert Comment

by:AJMartin
ID: 9777302
The SourceForge Layout Manager:
http://sourceforge.net/projects/dotnetlayout/
0
 
LVL 6

Expert Comment

by:DaniPro
ID: 9777450
If you set correctly the Anchor propery drawing the form at smallest size the resize of form work fine
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:AlexFM
ID: 9777953
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9781141
DaniPro, if I specify the anchor, the resizing does not expand any of the controls



0
 
LVL 6

Assisted Solution

by:DaniPro
DaniPro earned 100 total points
ID: 9785325
But if you Anchor a control to Top, Left, Right, Bottom, it will be resized....
Plese, give me an example of your problem
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9801929
My Anchored controls do not resize... please explain what you mean?  

If I have a RichTextBox in a form, and it is anchored topleft, when I resive the form, the text box does not grow accordingly.
0
 
LVL 1

Accepted Solution

by:
AJMartin earned 150 total points
ID: 9802024
What DaniPro is trying to explain is that your RichTextBox can be Anchor-ed like this:
MyRichTextBox.Anchor = (AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left);
And then when the form is resized, the RichTextBox will change size roughly proportionally to the form.
I hope that helps!
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9835566
oh, ok.  that sounds good.  If I anchor things inside of a panel, and anchor the panel, would that also happen correctly?  Also, can I do that in the designer, or only programmatically?
0
 
LVL 5

Author Comment

by:jjacksn
ID: 9835580
Nevermind, the designer was a stupid question.

thanks, that should work.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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