-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
  • 73,524
  • 17
  • 153
  • 317

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
  • 4,279
  • 2
  • 12
  • 34