Hi Brian,
Changing the userform size does not appear to change the size of the
controls within the userform. You need to use Zoom for that. The following
code tests for the video resolution and sets the useform Height, Width and
Zoom accordingly. However, some caveats. Video resolution Height and Width is
not proportional for all resolutions so there is some discreprencies in the
calculations, particulary with the Zoom, but it depends to some extent how
large you want the userform in relation to the usable screen size so you will
need to do some testing.
Note the comments. The API declaration must be at the top of the module
before any other subs. You will need to set the values depending on the
resolution of the screen on which the userform was developed.
'Video display code from the following lin
'
http://spreadsheetpage.com/index.php/site/tip/determining_the_users_video_resolution/
'API declaration (At top of module)
Declare Function GetSystemMetrics32 _
Lib "user32" _
Alias "GetSystemMetrics" _
(ByVal nIndex As Long) As Long
Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1
Sub Show_Userform()
Dim vidWidth As Long
Dim vidHeight As Long
Dim dblMultWdth As Double
Dim dblMultHt As Double
Dim dblZoom As Double
vidWidth = GetSystemMetrics32(SM_CXSCREEN)
vidHeight = GetSystemMetrics32(SM_CYSCREEN)
'1152 and 864 is initial setup resolution
'Edit to your setup screen resolution
dblMultWdth = vidWidth / 1152
dblMultHt = vidHeight / 864
dblZoom = (dblMultWdth + _
dblMultHt) / 2 'Average
With UserForm1
'Lookup in Help for other options
'for StartUpPosition. Needs to be manual
'for setting left and top positions.
.StartUpPosition = 0
.Zoom = 100 * dblZoom
.Width = .Width * dblMultWdth
.Height = .Height * dblMultHt
.Top = 200
.Left = 100
.Show
End With
End Sub