views:

44

answers:

1

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?

A: 

The Screen class contains a lot of functionality for this.

You should check for yourself if a form is outside the Bounds of the Screen, but this is pretty straightforward:

if (!Screen.GetWorkingArea(myWindow).Bounds.Contains(myWindow.Bounds)) {
   // Adjust location
}
GvS
That looks like it's the answer. I apparently fed the wrong terms to Google. I guess I was fixated on monitors instead of screens.
Loren Pechtel