Best way to resize vb6 forms for different screen resoultions

Have a VB6 project that contains multiple forms.  It was originally designed using 800X600 resoulition. We need to be able to accomodate for the various higher settings now available.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Maybe the following link will help?

Regards, Dennis


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SStoryCommented: sells an ActiveX suite that includes:

Back in the day there were several sizer controls that you just dropped items into. I think Infragistics also has one.  Or you can do it yourself by proportionally calculating the width/height and position of every single control from the start and on resize event. The problem is Font sizing and image stretching.

good morning!

this is a sample code...and i think it can give u idea..

Me.Width = Screen.Width
Me.Height = Screen.Height

using this code, the form size will vary depending on the resolution of the
computer. Now that u know the size of your Main Form, it is up to you
set size on your other forms.

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

VB.NET has panel controls and the ability to dock and anchor.  You could probably write the same thing in VB6 if you know how to write controls.  You could, for example, make a usercontrol and place the Picturebox control in it as a constituent control.  Set it's size always to the entire size of the UserControl itself.  Then when the resize event is called for that control, or by some public Sub in the control, you could resize it based upon the size of the container and some sort of percentages or something.  Whenever anyone added a control inside the Picturebox control--the one in your UserControl--which I think can contain other controls--you could record the size of that control relative to the size of the picturebox and any time that the picturebox was stretched, you could reposition, resize all controls inside of it.

This would all be a lot of work, mind you, but it can be done.

A less sophisticated way would be, everytime that the form resizes you set position and height/width of all controls on it based upon some percentage.

So if txtName.Width=50 when the form width is 500, and
txtName.Height=20 when the form height is 200 then txtName.tag could have been set to ".1,.1" because it is .1 the width of the form and it is .1 is the height of the form.  Then on each form resize you'd parse that value to split them up and set txtName.width=me.width * .1

This would help you set height and width. Unfortunately you'd also want to keep the relative position between all controls so you'd have to implement that in some way also.  One potential way to do this is:
Make a control that is visible at design time that can be set to horizonal or vertical orientation.  At runtime it would be invisible.  Put these controls between items horizontally and vertically.  the control, if horizontal would have a reference to the control to the left of it and right of it.  When the form was resized it would also be resized percentagewise and the key is that it would always have its left side touching the right side of the control to the left of it and then it would move the control to its right by setting the control to the right's left property to 1 pixel past its right side.  I have seen controls that already do this for sale back in the late 90's when I was in vb6.  Do it vertically would be similar.
Anyway you stack it, it is a lot of work.

Obviously, buying premade controls is the easiest way.  It may not be the cheapest, unless your time is worth a lot and then it would definitely be better/cheaper to buy premade/pretested/proven controls to handle it.
JackVannoyAuthor Commented:
Thanks to everyone who has responded to my question.  I am in the process of evaluating the responses, and trying the different approches. I will get back within the next couple of days with my results, and award the points.

JackVannoyAuthor Commented:
I want to cancel this because somehow I hit a wrong button.  I Do want to award points.  Don't know what happened
JackVannoyAuthor Commented:
I have got myself very confused.  I want to make sure that each of the four who responded to my question each get 125 points.  Would someone please advise me if somehow this is NOT what I accomplished.

He is asking for a point split. I only object to closing if it means no points..which is not what he has stated he wants to do.
JackVannoyAuthor Commented:
Thanks again for all of the help.  Sorry I got the first part of the close wrong.  Will try to be more accruate next time.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.