Results 1 to 5 of 5

Thread: Moving a form to another monitor

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    6

    Moving a form to another monitor

    I am working on a VB application that requires two monitors. The main monitor shows a windows media video clip and the other monitor contains another VBform that contains buttons. Clicking on a specific button, will direct the user to a specific chapter on the video clip. I can do the latter but I don't know how to move the form containing the buttons to the second monitor. Is there an API that will allow me to do this?

    TIA

    Mike

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Moving a form to another monitor

    What about just setting the forms location to a coordinate that will place it on the second monitor?
    VB Code:
    1. 'This will more it to the start of the second monitor if your runing 1024 x 768 resolution
    2. Form1.Move 1024 * Screen.TwipsPerPixelX + 1
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    6

    Re: Moving a form to another monitor(RESOLVED)

    Great that worked. The second monitor is to the left of the primary, so I just used
    VB Code:
    1. frmButtons.Move -1024 * Screen.TwipsPerPixelX + 1
    The second monitor is smaller so I just have to play with the settings to match it up.

    Thanks,

    Mike

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Moving a form to another monitor

    No problem

    If your second monitor is on the left of the primary then you could use the Display Settings to arrange the monitor configuration if that helps.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Moving a form to another monitor(RESOLVED)

    Quote Originally Posted by mevasquez
    The second monitor is to the left of the primary, so I just...
    I'm curious...

    Doesn't that cause the desktop icons to migrate to the secondary monitor? That's what happens to me if I select "LEFT" side for the secondary (that's with a laptop)...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

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



Click Here to Expand Forum to Full Width