screen-resolution

J

Jan Hx.

Hi,

I want to use the Form_Load-procedure to do some 'controls-rearanging'
depending on the screenresolution.
How do I find out wich resolution is being used?

Thanx!
Jan Hx.
 
T

Tim

Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Declare Function apiGetSys Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long


Public Function ScreenWidth() As Long
ScreenWidth = apiGetSys(SM_CXSCREEN)
End Function

Public Function ScreenHeight() As Long
ScreenHeight = apiGetSys(SM_CYSCREEN)
End Function
 
J

Jan Hx.

Tnx Tim! It works just fine!

Tim said:
Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1

Private Declare Function apiGetSys Lib "user32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long


Public Function ScreenWidth() As Long
ScreenWidth = apiGetSys(SM_CXSCREEN)
End Function

Public Function ScreenHeight() As Long
ScreenHeight = apiGetSys(SM_CYSCREEN)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top