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

How to resize controls based on screen resolution vb.net

I am building a vb.net application using visual studio 2003,  I need the controls to resize based on the screen resolution.  How can i do this?  I know how to get the resolution, but is there an easy way to scale the controls to fit?  Right now the application looks perfect when resolution is set to 1024 by 768, but it looks jumbled when set to 800 by 600.  I am using anchors and docking to but keep them in the correct positions.
0
tentavarious
Asked:
tentavarious
  • 4
  • 4
  • 3
1 Solution
 
Wayne Taylor (webtubbs)Commented:
Hi tentavarious,

Anchors and Docking are the suggested methods for ensuring control/form proportions are kept.

Regards,

Wayne
0
 
tentavariousAuthor Commented:
I am using anchors and docking but my buttons, labels and user controls dont shrink to fit when I change the resolution to a smaller size.
0
 
Wayne Taylor (webtubbs)Commented:
tentavarious

You should build your forms based on the lowest possible resolution, and avoid scaling down.

Wayne
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
tentavariousAuthor Commented:
Well if the user increases the resolution there would be way too much space.  Anchoring and docking can only do so much, I need to actually change the width/height of the controls, which I can do, but I was wondering if there was .net class that would simplify the process.
0
 
Wayne Taylor (webtubbs)Commented:
No such class I'm afraid. The only other way to resize is to handle the forms Resize event, and resize your controls in there.

Wayne
0
 
Fernando SotoCommented:
Hi tentavarious;

What you want is called resolution independence and Microsoft only supports that from Vista and whatever comes after it.

In order to get this on MS operating systems before Vista you will need to resize all controls on the form based on the current resolution settings before displaying the form. Or you can buy a product that will do this for you automatically.

The following link has such a product for sale
.Net Forms Resize By Soft Group
http://www.soft-group.it/net/index.php?c=3

There may be others you can see if there is by using a internet search on "resolution independence".

Fernando
0
 
Fernando SotoCommented:
Hi tentavarious;

BTW, I have not used the product from my last post. There web site does allow you to download and try it out.

Fernando
0
 
tentavariousAuthor Commented:
Ok, I think i can come up with something to resize the controls upon the form loading, if it doesnt work, i will give that product a try.
0
 
Fernando SotoCommented:
Be aware that controls that display text, the font size will also need to be re-sized by using another font size.
0
 
tentavariousAuthor Commented:
yep also i need to deal with a spacing issue between controls not sure how to handle that yet.
0
 
Fernando SotoCommented:
That is correct.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 4
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now