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
TWidth% = Screen.Width \ Screen.TwipsPerPixelX
THeight% = Screen.Height \ Screen.TwipsPerPixelYMsgBox "屏幕大小为" + CR$ + CR$ + Str$(TWidth%) + " x" + Str$(THeight%), 64, "Info"
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