Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Help - Dual Display

Help - Dual Display

Scheduled Pinned Locked Moved C#
csharphelptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Craig G Fraser
    wrote on last edited by
    #1

    Can anyone tell me if its possible and how to programatically (in c#) open a dialog on a secondary display monitor ? ie: The main app interface displays on the primary monitor and on certain events a dialog is opened/displayed on the secondary monitor ? Any help will be greatly appreciated. Cheers Craig

    H 1 Reply Last reply
    0
    • C Craig G Fraser

      Can anyone tell me if its possible and how to programatically (in c#) open a dialog on a secondary display monitor ? ie: The main app interface displays on the primary monitor and on certain events a dialog is opened/displayed on the secondary monitor ? Any help will be greatly appreciated. Cheers Craig

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You can use the Screen class to get the bounds of the second (if any) screen and set your window's location accordingly. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

      C 1 Reply Last reply
      0
      • H Heath Stewart

        You can use the Screen class to get the bounds of the second (if any) screen and set your window's location accordingly. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

        C Offline
        C Offline
        Craig G Fraser
        wrote on last edited by
        #3

        Heath, Thanx for the info - will try that solution. Is there any chance of providing me with a code snippett ?? Cheers Craig

        H 1 Reply Last reply
        0
        • C Craig G Fraser

          Heath, Thanx for the info - will try that solution. Is there any chance of providing me with a code snippett ?? Cheers Craig

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          Read the documentation for the Screen.PrimaryScreen property. Do the same for the second screen, if any, like so:

          Rectangle area = Screen.PrimaryScreen.WorkingArea;
          if (Screen.AllScreens.Length > 1)
          area = Screen.AllScreens[1].WorkingArea; // arrays in .NET are 0-based.

          There are lots of examples of how to use the classes, members, etc. in the .NET BCL in the .NET Framework SDK (which gets installed by default with VS.NET, is downloable as separate documentation and tools, or is available online at http://msdn.microsoft.com/library[^]). This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups