picBoxes
is an array of PictureBox
. Each element is of type PictureBox
.
You have this line:
picBoxes[i] = new MyPictureBox();
When you are trying to assign an incompatible type.
If you change it to:
picBoxes[i] = new PictureBox();
It will work.