Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

dynamic screen resolution for a vb install

Posted on 2004-08-27
5
Medium Priority
?
226 Views
Last Modified: 2013-12-25
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?

Thanks.
0
Comment
Question by:MikeORTEC
  • 2
  • 2
5 Comments
 
LVL 27

Assisted Solution

by:Dabas
Dabas earned 800 total points
ID: 11919574
Hi MikeORTEC:
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!

Dabas
0
 

Author Comment

by:MikeORTEC
ID: 11920658
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?
0
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 400 total points
ID: 11922402
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 ...

OHDev
0
 
LVL 27

Assisted Solution

by:Dabas
Dabas earned 800 total points
ID: 11923406
Mike:
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)

Dabas
0
 

Author Comment

by:MikeORTEC
ID: 11950636
Thanks for your help!  I split the points and appreciate the thoughtful comments.


Mike
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

772 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