In my previous example you would have to do something like this.
I am aware that this is just a workaround. Even in a garbage collected system ther must be a way to create an array of pointers.Code:for(int i = 0; i < 5; i++) { PictureBox* picBlock = new PictureBox(); pnlGameField->Controls->Add( picBlock ); switch ( i ) { case 0: picBlock->Top = 100; picBlock->Left = 50; break; case 1: picBlock->Top = 150; picBlock->Left = 50; break; // ...... } }
Kurt