nuclear sweet
nuclear sweet

Reputation: 1121

How should i use VirtualScreenLeft and VirtualScreenTop

In my application i need to know size of all monitors combined space, to adjust size of the window if it goes to big.

I found VirtualScreenWidth and VirtualScreenHeight in System.Windows.SystemParameters and it seems like what i need. But also i wonder what is VirtualScreenLeft and VirtualScreenTop and how i should take it in consideration? In which scenarios this values are set to not 0?

Upvotes: 0

Views: 430

Answers (1)

Ron Beyer
Ron Beyer

Reputation: 11273

The virtual screen is the bounding box containing all the monitors of the system. The bounding box is referenced at 0,0 being the upper-left corner of the main monitor (the main-monitor is defined in the system properties).

This means that the bounding box can have negative numbers as the Left/Top values. For example, lets say you have 2 1920x1080 monitors. The main monitor is set to the one on the right (but level at the top), the bounding box will be -1920,0,3840,1080 (x,y,w,h).

If you move the left monitor up 500 pixels, the bounding box becomes -1920,-500,3840,1580. Its important to note that some areas of the bounding box will not be visible to the user, so if you are designing a screen that takes up as much area as both monitors have, be aware that they may not be set up in a rectangular shape. They also may not be both the same resolution.

Upvotes: 1

Related Questions