• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 48
  • Last Modified:

Resizing all controls when resizing the Form

In VB6 I used a code that would resize all the controls and font sizes if the Form would be enlarged. Also, when I reduced the size of the Form that same code would resize all controls and font sizes accordinly.
In VB.Net, when I want to resize the Form to enlarge or reduce it, using the "Anchor" property, all the controls and font sizes in the Form do not resize uniformly.
I need a code that will resize all controls and Font sizes according to the size of the Form.
Thank You
0
Moshe Singer
Asked:
Moshe Singer
  • 6
  • 5
1 Solution
 
Moshe SingerAuthor Commented:
in vb6 if i use "For Each ctl In Controls" it is changing all conrols even controls in a TabControl



if vb.net For if i use "Each Ctrl As Control In Controls" it it is changing only conrols thet are NOT in a TabControl
it is changing the size of the TabControl, and not the controls thet in it
0
 
Fernando SotoCommented:
If that is what you really need you will need to get a third party tool which will handle that. I did a quick search on the web and found this product called Shell MegaPack and you can download a free trial before buying. One of the features is call Resizer component with automatic resizing and resolution-independence which should do what you need.
0
 
Moshe SingerAuthor Commented:
I downloaded the the trial version of Shell MegaPack for the Resizer component and it resized the form nicely, but it did not resize the fonts in the Labels that are in a "GroupBox".
Also, a ListBox from Component One C1TrueDBGrid was also not properly resized.\
I need this Resizer component to be reliable for all components of the application.
In VB6, one code took care of everything. Can you please advise.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Fernando SotoCommented:
As for the fonts you need to use True Type font type because they are scaleable, be aware that when selecting fonts they need to also exist on the users system otherwise another font will replace it . As far as the Component 1 control I do not know. As I stated I searched the web for the link I posted and have no experience with the product.
0
 
Fernando SotoCommented:
Here is a different product which claims to be even better and to implement the resizing with just one line of code in the forms load event. They also have a 30 day evaluation copy to download.

.Net Forms Resize by Softgroup
0
 
Moshe SingerAuthor Commented:
i am still testhing out this resize from http://www.componentsource.com/products/net-forms-resize/index.html

i get an error and wathing for respons from componentsource
0
 
Fernando SotoCommented:
Hi angelIII;

The last post I posted is the software I suggested and ToviaSchlesinger was testing. He posted no comment after that. It must have done what he needs.
0
 
Moshe SingerAuthor Commented:
i dont have any solotion wow to aut resize a form with all controls on it - in vb.net
can someone provide a solotion on this?
0
 
Fernando SotoCommented:
You state, "In VB6, one code took care of everything", VB.Net is NOT VB6. Have a look on this Microsoft documentation Automatic Scaling in Windows Forms look at the section Automatic Scaling in Action.
1
 
Moshe SingerAuthor Commented:
it looks thet this address
https://msdn.microsoft.com/en-us/library/ms229605(v=vs.110).aspx
is the solotion
thanks a milion
0
 
Fernando SotoCommented:
Glad that helped. Please close the question by awarding the solution the points.

Thank you.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now