Problem : Controls.Find()
method returns the Control[]
Array
Solution : You need to Access the First Element of the Controls Array to cast it backto PictureBox
.
Replace This:
pictureBoxList.Add((PictureBox)Controls.Find("pictureBox" +i, true));
With This:
pictureBoxList.Add((PictureBox)Controls.Find("pictureBox" +i, true)[0]);