Resolution

I LOVE VB
01-12-2005, 03:31 AM
I need a code to use at Form_Load.
It should check that if resolution is less than 800*600 then terminates the application and Unload/End it.

stevo
01-12-2005, 03:34 AM
alter this to your requirements

Dim x As Integer, y As Integer

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

MsgBox x & " x " & y

herilane
01-12-2005, 03:39 AM
Lots of ways to do this...
One simple example here (http://support.microsoft.com/?kbid=210106)
Or use GetSystemMetrics (with SM_CXSCREEN and SM_CYSCREEN).

Forgot about the Screen object... sorry, I'm a VBAer and we don't have that luxury in VBA

Nrees87
01-12-2005, 04:52 AM
Easiest way of all:


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


Nathan Rees.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum