Hi Rolf,
First we need to know what is called "Virtual Screen": The bounding
rectangle of all the monitors is the virtual screen. The desktop covers the
virtual screen instead of a single monitor. See following for more info,
there's a picture illustrates a possible arrangement of three monitors.
#The Virtual Screen
http://windowssdk.msdn.microsoft.com/en-us/library/ms534613.aspx
The primary monitor contains the origin (0,0). This is for compatibility
with existing applications that expect a monitor with an origin. However,
the primary monitor does not have to be in the upper left of the virtual
screen.
When you use WinForm's Location to read the coordinate of the left-top
point of your window, it sometimes can be negative (relative to the primary
monitor's position).
From your example of 1000x1000, 2000x2000 monitors and location
(1500,1500), I understand your concern: you will know that the location is
not on the primary monitor (using Screen.FromControl(this) to get the
screen, then check the Screen.Primary property).
To know if the second screen is on right or bottom of the primary one, you
need to check the Screen.Bounds property, if it's on right side, the Left
property will be 1000; if it's on the bottom side, the Left property will
be 0.
Actually it's not difficult to simulate the display control panel applet to
draw the rectangles represents the screens positions, you just need to know
they're on the same virtual screen, and you can know their positions using
their Bounds property.
Let me know if you need further information.
Regards,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.