-2

So the code is:

this.Location = Screen.AllScreens[1].WorkingArea.Location;

problem Message "Index was outside the bounds of the array." string

enter image description here

GSerg
  • 76,472
  • 17
  • 159
  • 346

1 Answers1

0

Index was outside the bounds of the array

Arrays start at zero.

Change your code to this

this.Location = Screen.AllScreens[0].WorkingArea.Location;
Farhad Zamani
  • 5,381
  • 2
  • 16
  • 41