Solved

Resizing all controls when resizing the Form

Posted on 2014-03-27
13
24 Views
Last Modified: 2016-07-10
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
Comment
Question by:Moshe Singer
  • 6
  • 5
13 Comments
 

Author Comment

by:Moshe Singer
ID: 39959425
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
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39959495
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
 

Author Comment

by:Moshe Singer
ID: 39959841
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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39960015
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
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 39960060
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
 

Author Comment

by:Moshe Singer
ID: 39976608
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
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 41694323
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
 

Author Comment

by:Moshe Singer
ID: 41701815
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
 
LVL 63

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 41701932
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
 

Author Comment

by:Moshe Singer
ID: 41702006
it looks thet this address
https://msdn.microsoft.com/en-us/library/ms229605(v=vs.110).aspx
is the solotion
thanks a milion
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 41702025
Glad that helped. Please close the question by awarding the solution the points.

Thank you.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

831 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