海贼王斯巴克·贾巴:在VB中测试屏幕分辨率的控件

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 22:23:33

不需要控件,两种方法实现

Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Sub Command1_Click()
With Screen
Me.Print .Width \ 15
Me.Print .Height \ 15
End With
End Sub

Private Sub Form_Load()
Me.AutoRedraw = True
Me.Print "宽:" + Str$(GetSystemMetrics(0))
Me.Print "高:" + Str$(GetSystemMetrics(1))
End Sub