View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Michel Pierron[_2_] Michel Pierron[_2_] is offline
external usenet poster
 
Posts: 63
Default How to position form in same place with different screen resolutions

Hi Joe 90;
Roughly and simply:

Private Sub UserForm_Initialize()
Me.StartUpPosition = 0
With Application
.WindowState = xlMaximized
Dim W&: W = .Width
' Zoom factor (1024 pixels = 768 points)
Me.Zoom = CInt(100 * W / 768)
Me.Top = .Height - .UsableHeight - 22
Me.Left = W - Me.Width - 19
End With
End Sub

Regards
MP

"Joe 90" (remove silly spam) a écrit dans le message de
...
Hi

Have a little form I use as a popup to take user back to main worksheet. My
dev env is running at 1024x768, but users run at 800x600.

the top and left properties work from top and left, so only ever give a
relative position from top and left. So if the resolution goes down, the
form vanishes off to the right!

I don't want the popup to obscure the data/charts I am using, how can I make
it always go to a top right position, or even better inside the excel window
(below the toolbars and to the left of the vertical scroll bar).

Regards

Joe