+ Reply to Thread
Results 1 to 1 of 1

User Form Startup Position

  1. #1
    Registered User
    Join Date
    11-09-2016
    Location
    London, England
    MS-Off Ver
    2010/2016
    Posts
    61

    User Form Startup Position

    Hi,

    I've read a few samples on how to get a form to open central on the active window (active in my sense is the same window as Outlook, or other Office app is running), but it doesn't seem to work for me.

    For reference, we have a mixture of screen setup's where I work:

    Surface Pro's connected to a Surface Dock which in turn is connected to 1 or 2 external monitors. If 2, one can be portrait and the other landscape, or both landscape
    Traditional PCs with 1 or 2 external monitors. Again, if 2, one can be portrait and the other landscape, or both landscape

    There is no standard layout: the left or right can be either portrait on landscape, with the Surface some people have it as an active screen (to left, right or underneath) and some people have it disabled so just external monitors. With any setup, unless both are landscape the 'heights' of the monitors don't line up - I've attached an example (this is my personal Surface layout)

    If I Debug.Print these:

    (Application.ActiveWindow.Top + Application.ActiveWindow.Height / 2) - (Me.Height / 2)
    (Application.ActiveWindow.Left + Application.ActiveWindow.Width / 2) - (Me.Width / 2)

    this is what I get:

    Outlook maximised on Surface screen:

    2463.17500305176
    -4379.625

    Outlook maximized on landscape screen:

    901.175003051758
    1644.375

    Outlook maximized on portrait screen:

    989.175003051758
    4644.375



    I think this is where my problems arise?

    Thanks

    screen-layout.PNG
    Last edited by ldoodle; 07-11-2018 at 06:36 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Workbook startup screen position?
    By terrypin in forum Excel General
    Replies: 8
    Last Post: 03-02-2017, 12:44 PM
  2. Populate text boxes on user form, from combo box on same user form
    By Richardswaim in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 07-03-2016, 09:35 AM
  3. [SOLVED] Userform - startup position
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 03-23-2014, 01:44 PM
  4. [SOLVED] User Form to execute search and return all values to the user form for editing
    By allwrighty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2013, 10:40 PM
  5. Start Up position of User Form
    By Shazz in forum Excel General
    Replies: 3
    Last Post: 03-07-2012, 12:54 PM
  6. Control Startup Position of UserForm
    By Mordred in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2011, 01:31 PM
  7. Set Vertical Scrollbar Position In User Form Listbox
    By Spencer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2011, 11:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1