0

I've written an application in csharp that uses the whole screen in the user's computer.

I want to check if the user has multiple displays and be capable to change the application from one display to another.

How can I check the current number of displays and change my window from one display to another programatically?

4

2 に答える 2

2

Use the screen class - http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.aspx

于 2012-05-25T20:06:48.677 に答える
1

System.Windows.Forms.Screens.AllScreens provides an array of screens that contain Bounds properties. You have to add a reference to Windows.Forms to your project, and then detect the count of the array. To set the window to the second screen, simply set the left value of the window to the Width of the first screen. Also, make sure to update the width and height to match the new screen as well.

Truly, multiple screen setups are great for developers, but a hassle to program for...

于 2012-05-27T07:34:18.713 に答える