ResWidth = Screen.Width/Screen.TwipsPerPixelX ResHeight = Screen.Height/Screen.TwipsPerPixelY ScreenRes = ResWidth & "x" & ResHeight ResWidth和ResHeight分别表示屏幕的宽和高,比如这样的结果: 800x600 ___________________________________________________________________当然,也可以利用API函数 Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long 把其中的uAction设为SPI_GETWORKAREA
___________________________________________________________________当然,也可以利用API函数
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
把其中的uAction设为SPI_GETWORKAREA
高度=Screen.Height\Screen.TwipsPerPixelY
'判断屏幕的大小比例,选用不同规格的背景图片
StrScreen = CStr(Screen.width \ Screen.TwipsPerPixelX) & " * " & CStr(Screen.height \ Screen.TwipsPerPixelY)
On Error Resume Next
If StrScreen = "800 * 600" Then
Me.Picture = LoadPicture(App.Path & "\Images" & "\800600.jpg")
ElseIf StrScreen = "1280 * 1024" Then
Me.Picture = LoadPicture(App.Path & "\Images" & "\1024768.jpg")
Else
Me.Picture = LoadPicture(App.Path & "\Images" & "\1024768.jpg")
End If