Solved

Is there an easy way to resize forms?

Posted on 2003-11-19
10
497 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

10 Experts available now in Live!

Get 1:1 Help Now