Solved

Resizing all controls when resizing the Form

Posted on 2014-03-27
13
27 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
[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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Open a link in vb.net 2 26
Code enhancement 4 33
VB.Net creating Contact in Outlook 1 55
Import a excel sheet in a grid 2 9
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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