The latest video drivers can change the display resolution without rebooting. Unfortunately, the Screen object doesn't always properly return the new display size; it only remembers the display size when the app first used it. This behavior appears to be driver-dependent, although it might be produced by the operating system (it occurs on my Windows NT machine but not on my Windows 98 system). If you need to determine screen dimensions at any time other than the Form_Load event, use the Windows API rather than the Screen object:
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function GetDesktopWindow Lib _
"user32" Alias "GetDesktopWindow" () As Long
Private Declare Function GetWindowRect Lib _
"user32" Alias "GetWindowRect" (ByVal hwnd _
As Long, lpRect As RECT) As Long
Public Function ScreenWidth() As Single
Dim R As RECT
GetWindowRect GetDesktopWindow(), R
ScreenWidth = R.Right * Screen.TwipsPerPixelX
End Function
Public Function ScreenHeight() As Single
Dim R As RECT
GetWindowRect GetDesktopWindow(), R
ScreenHeight = R.Bottom * Screen.TwipsPerPixelY
End Function