dynamic screen resolution for a vb install

Here is a good one.

I created an application in vb6 that manages data and information from an access database.  On my machine, I can install and run the exe and it "looks" just as nice as in debug.  But I sent it to a tester and on his computer, the windows are not the same as on my machine.  there are text boxes that are off the screen...just does not look right.  How can I set the properties of the project so that it "looks" the same accross operating systems and computers?

Who is Participating?
OHDev2004Connect With a Mentor Commented:
sorry for Putting my nose in this :P but it's Dabas's Effort in the End he started the path :P...

yes you can .. there is a Command called Screen where you can retrieve several information About the screen ..
so if you want to know the Resolution you can do the Following:

Dim ResolutionX As Integer, ResolutionY As Integer
ResolutionX = Screen.Width / Screen.TwipsPerPixelX
ResolutionY = Screen.Height / Screen.TwipsPerPixelY
MsgBox "your Current Resolution is " & ResolutionX & "X" & ResolutionY

this will store the screen resolution Horizontal(ResolutionX) and Vertical(ResolutionY) and you can Compare it ...
so whenever the resolution is Larger than the Original one you developed on let's say it's 1024*768 and the detected Resolution is Larger like 1280*1024 so there's no need to tell the User to change the Resolution ...
the only state where the user needs to change the resolution if the detected one is Smaller than the one you developed the program on ...

DabasConnect With a Mentor Commented:
I suspect you are developing on a system with a 17" Monitor (or maybe even 19"), while your tester probably is using a smaller monitor than yours.
By right clicking on any place on your desktop and clicking on Properties, and then Settings, you can find out the resolution of your screen, (and the one of your tester)
Assuming yours is 1024 X 768, and your tester is 800 X 600, you will have to change your form so that it will fit on the latter.

To do that, in Visual Basic, click on View, Form Layout Window. Run your program and return to design mode.
The form layout window will have appeared docked on the right hand side of your screen, and will guide you on how to size your forms for lower resolutions than what you are developing on.

Good luck!

MikeORTECAuthor Commented:
Thanks Dabas.  That makes sense and is thankfully simpler that I thought it would be.  I developed the application on a laptop with an overly wide screen...unusal screen dimensions.  From the design environment Form View layout I am using the grid guides to relook at position and size of forms.  It appears that there are limits for screen resolution.  Is there a way to detect screen resolution on install (or first use) and ask the user to set it to a value?
DabasConnect With a Mentor Commented:
I agree with OHDev's reply with a few extra notes:

1) Although you CAN find out the resolution, I do not think it is a good idea to ask anybody to change their settings.
If their settings are lower than yours, there probably is a reason. (Maybe their monitor is a 15", and the font becomes so small that it is nearly unreadable, or the user is visually impaired and prefers to have the larger fonts?)

2) As suggested before, you should convert your forms to a lower resolution. (800 X 600 is quite universal now, I doubt anbyody is still using the lower 640 X 480)
If you have so many controls that it does not fit, then I suggest you use one of the two tab controls (I personally prefer the Microsoft Tabbed Dialog Control).
If you like the form to be maximized and the controls spread evenly, then play around with the control's left and top properties to do so. (The Form_Resize event would be the best place to have code to do that)

MikeORTECAuthor Commented:
Thanks for your help!  I split the points and appreciate the thoughtful comments.

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.

All Courses

From novice to tech pro — start learning today.