Hi davidm,
Try something like this code into the form's initialize event:
Private Sub UserForm_Initialize()
Dim w As Long, h As Long
w = GetSystemMetrics32(0) ' width in points
h = GetSystemMetrics32(1) ' height in points
If w = 800 And h = 600 Then
Me.Width = 75
Me.Height = 60
ElseIf w = 1024 And h = 768 Then
Me.Width = 75 * 3
Me.Height = 60 * 2
Me.Zoom = 130
ElseIf w = 1280 And h = 1024 Then
Me.Width = 75 * 4
Me.Height = 75 * 3
Me.Zoom = 200
Else
MsgBox "What kind of resolution are you using?!?"
End If
End Sub
And this code in a standard module:
Declare Function GetSystemMetrics32 Lib "User32" _
Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
Bookmarks