Solved

Resizing all controls when resizing the Form

Posted on 2014-03-27
13
19 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 62

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
 
LVL 62

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 62

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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 62

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 62

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 62

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now