views:

579

answers:

1

As the question suggestions, should I be checking the Rectangle to set a Form.Location (which is taken from a Settings file) based on:

1.

if (settings.X <  Screen.PrimaryScreen.WorkingArea...)
{
  // Set the form's Location based on the settings object
}

or

2.

int width = 0;
foreach (Screen screen in Screen.AllScreens)
{
    width += screen.WorkingArea.Width;
}

if (settings.X <  width...)
{
  // Set the form's Location based on the settings object
}

Or is there a simple one liner that does the task of #2? I'm working on dual monitors, but the user base may have any number of configurations.

+1  A: 

Perhaps my answer on this different question helps in this case too:

Restoring Window Size/Position With Multiple Monitors

VVS
Looks like I have a duplicate
Chris S