Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen Resolution Question

Status
Not open for further replies.

Catrina

Programmer
Feb 11, 2000
70
US
I have designed my application using 800 X 600 resolution. If a user's machine is set at 640 X 480, my forms run off the screen.

Is there a way to 1. Check the settings when my application is run each time so I can pop up a message that the resolution must be changed before running, or better yet 2. Change the setting via code when my program runs, and then reset when my program ends.

I have searched a little on the MS website, but no luck. I am rather new to VB, so descriptive answers would be appreciated.

Thanks for any help

Catrina [sig][/sig]
 
Check out
scalemode
twipsperpixelx
twipsperpixely
scalex
scaley
[sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
Also,
If you do everything in pixels instead of twips, it will look the same everywhere. [sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
Catrina,
create a module. in the module paste this:
Code:
Public Type POINTAPI
        x As Long
        y As Long
End Type

Public Declare Function GetCursorPos Lib &quot;user32&quot; (lpPoint As POINTAPI) As Long

Create a form, in the general declaration portion paste this:
Code:
Dim MousePos As POINTAPI
Private Sub Form_Activate()
GetCursorPos MousePos
Me.Move MousePos.x * Screen.TwipsPerPixelX, MousePos.y * Screen.TwipsPerPixelY
End Sub

This will display your application where ever they clicked to start it.

hth
Scoty ::) &quot;Learn from others' mistakes. You could not live long enough to make them all yourself.&quot;
-- Hyman George Rickover (1900-86),
 
To get Screen width and height

Width = Screen.Width / Screen.TwipsPerPixelX
Height = Screen.Height / Screen.TwipsPerPixelY

Chaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top