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
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
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货