Solved

Is there an easy way to resize forms?

Posted on 2003-11-19
10
479 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
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!
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

14 Experts available now in Live!

Get 1:1 Help Now