Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long    'Constants for GetSystemMetrics     Const SM_CXSCREEN = 0        ' Width of screen
     Const SM_CYSCREEN = 1        ' Height of screen
Sub Get_System_Metrics()    Dim XVal As Long, YVal As Long
    YVal = GetSystemMetrics(SM_CYSCREEN)
    XVal = GetSystemMetrics(SM_CXSCREEN)
    MsgBox "您的屏幕分辨率为: " & XVal & " X " & YVal
    
End SubPrivate Sub Command1_Click()
Get_System_Metrics
End SubPrivate Sub Command2_Click()
    MsgBox "您的屏幕大小为: " & Screen.Width & " X " & Screen.HeightEnd Sub