Reputation: 9093
I'm looking for a way to check to see that a window I am creating is visible and entirely on one monitor. I have seen too many programs do nasty things when they try to restore their position and the place no longer exists and I don't want my program to be vulnerable to this.
How do I find the information on the actual layout of the monitors?
Upvotes: 3
Views: 865
Reputation: 51
Just a small syntax correction, or perhaps an update in Visual Studio 2012:
if (!Screen.GetWorkingArea(myWindow).Contains(myWindow.Bounds))
{
//Adjust location
}
Upvotes: 3