Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Positioning of where a UserForm pops up 2

Status
Not open for further replies.

clouddog9

Technical User
Jul 31, 2009
55
US
Is there a way to control where a userform pops up? I have recently been given two monitors at work. My custom form pops up on the other monitor in what I think would be the middle is I had a monitor that large. My problem will be when I remote in the form will not be available on my home computer. Any help would be appreciated.
 
Set StartUpPosition to 0 (Manual) and next set Left/Top position.

combo
 
I haven't done this before. What is the code?
 



StartUpPosition, Left & Top are all properites of the userform object. Check VBA Help for properties of the userform object.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
An example:
UserForm1.StartUpPosition = 0
UserForm1.Top = 0
UserForm1.Left = 0

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can also set StartUpPosition, Left and Top in design mode without code, in the Properties window.
If Left/Top are to be dynamic, they can be set with Initialize event:
Code:
Private Sub UserForm_Initialize()
Me.Left = varLeft
Me.Top = varTop
End Sub[/code
 

combo
 
Default positioning of userforms on dual monitors is interesting (it depends which monitor the VBE is on) but it may be the least of your problems when you switch between single and dual monitor setups (whether remotely or not). When you close down applications, many of them will reopen on the monitor they were last on - if this is the second monitor, they will not be visible on single monitor configurations and you will have to use the keyboard blind to move them into view.

Unless your users are going to have dual monitors as well, I wouldn't worry too much about what they will see - the default position will be just fine. The problems will start to arise if you try to add special case code for your own unique situation.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
>... dual monitors is interesting ...

Tooltips for UserForms displayed on monitors other than the primary monitor may not appear on the intended monitor instead they appear around the edges of the primary monitor.
 
Thanks to all for the help.

TonyJollans, I will take your advice because I think I am the only one in my department with dual monitors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top