"EllenM" wrote:
> I came across the "StartUpPosition Property" which allows the developer to
> specify the location of a userform when it first appears onscreen.
> Unfortunately, the settings only give you 4 options which do not allow much
> positional control of a userform. I have a large form with an embedded button
> such that when the button is clicked, it launches a smaller form (a calendar)
> in front of the large form. I would like the smaller form to appear slightly
> off-center, not dead center. Is there a way to do this?
For something like this you need to first find out what the user's screen
resolution is, otherwise you might position the userform totally off the
screen!
Once you know that, you can calculate where to position the ".Top" and
".Left" proprerties of the userform in its Initialize event.
To get the Screen Resolution:
Dim lngHor As Long
Dim lngVert As Long
With System
lngHor = .HorizontalResolution
lngVert = .VerticalResolution
End With
MsgBox lngHor
MsgBox lngVert
Then you need to apply some percent type of calculation to position the
userform as you wish. Of course, thorough testing is recommended. Change your
screen resolution and then run your code to see the results.