Solved

Is there an easy way to resize forms?

Posted on 2003-11-19
10
519 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

705 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