views:

303

answers:

2

Hello everyone,

I am using VSTS 2008 + C#. Is there any way to get the informaiton like, whether we are currently in dual monitor mode, how much is the current resolution of each desktop?

BTW: there are two modes of dual screen, duplicate screen or extended screen. I need a solution as well to distinguish between the different modes.

thanks in advance, George

+2  A: 
System.Windows.Forms.Screen

provides you with screen data. Duplicate screen is not really considered another screen from an application point of view.

Mehrdad Afshari
+4  A: 

System.Windows.Forms.Screen.AllScreens

Gets an array of all displays on the system.

The property Primary

Gets a value indicating whether a particular display is the primary device.

And the Bounds property may be the solution for the rest.

System.Windows.Forms.SystemInformation.VirtualScreen Property

Might be usefull for you, to determine if the primary monitor is cloned or extended.

VirtualScreen resolution higher than the ones of primary -> extended...

VirtualScreen resolution = the ones of primary -> cloned...

Peter
So, if more than one Screen element is in AllScreens? Means currently in multple user mode?
George2
Sorry for late reply, I did some experiment today. I am confused about what is the meaning of Top (and Left) property of Bounds property of Screen? For primary screen, I find they are always zero, but for non-primary screen, what is the meaning/function of Left/Top?
George2