userform, StartUpPosition

  • Thread starter Thread starter Peter Ostermann
  • Start date Start date
P

Peter Ostermann

Hi folks,

to position a user form rightmost on the monitor
I miss a preset constant for the property
StartUpPosition aside of 'manual', 'centerowner',
'centerscreen' and 'windows default'.

To set 'left' manually by a program-function at least
I need to detect the screenwidth of the present monitor
but do not know how.

Can somebody help me out, maybe even with a
code example right away (for not to invent the wheel
again :-) )?
Thanks.

Regards
Peter
 
Peter

The following is code I got from this group and use a lot:

Application.WindowState = xlMaximized
Me.Top = 0
Me.Left = 0
Me.Height = Application.Height
Me.Width = Application.Width

Of course it does not do exactly what you want, but, I think it could
get you started. To position a userform to the right, you could go
with

Me.Left=Application.Width - Me.Width

and

Me.Left=0

will put it on the left. The maximizing statement may or may not be
relevant to your situation.

Good luck.

Ken
Norfolk, Va
 
Hi John,

thanks for the hint, but....

John Bundy said:
This returns the vakue for the msoScreenSize, just search for what each
value
represents

MsgBox Application.DefaultWebOptions.ScreenSize

....... using that statement it returns "3", what ever that means.

Regards
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top