Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
 Const SM_CXSCREEN = 0    'x
 Const SM_CYSCREEN = 1    'y

解决方案 »

  1.   

    不需要Api
    TWidth% = Screen.Width \ Screen.TwipsPerPixelX
    THeight% = Screen.Height \ Screen.TwipsPerPixelYMsgBox "屏幕大小为" + CR$ + CR$ + Str$(TWidth%) + " x" + Str$(THeight%), 64, "Info"
      

  2.   

    form里
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
     Const SM_CXSCREEN = 0
     Const SM_CYSCREEN = 1
     
     
    Private Sub Form_Load()
     Dim x As String
     Dim y As String
     n = Str(GetSystemMetrics(SM_CXSCREEN))
     y = Str(GetSystemMetrics(SM_CYSCREEN))
     Label1.Caption = "当前的显示器的分辨率是:" + n + "x" + y
     
    End Sub
      

  3.   

    huxiangming(老虎) 的方法最好