Solved

dynamic screen resolution for a vb install

Posted on 2004-08-27
5
216 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 200 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 100 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 200 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now