by http://www.coderhq.com (4 Submissions)
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 4th April 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Returns the current screen resolution w/o API calls
' Paste the following into the declarations
' of your form then run project
'
' For more snippets please visit
' http://www.coderhq.com
Private Sub Form_Load()
MsgBox GetScreenRes
End Sub
Public Function GetScreenRes()
Dim ScreenX As Long
Dim ScreenY As Long
ScreenX = Screen.Width / Screen.TwipsPerPixelX
ScreenY = Screen.Height / Screen.TwipsPerPixelY
GetScreenRes = ScreenX & "x" & ScreenY
End Function