• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1328
  • 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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
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 SotoRetiredCommented:
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 SotoRetiredCommented:
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 SotoRetiredCommented:
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 SotoRetiredCommented:
That is correct.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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