Hi Andrej,
I think your code is in VB.NET, isn't it?
actually I'm using C++.NET and I've tried a similar codein the form-Load action, but it seems that I cannot declare a new control (pictureBox - in my case ) inside this form_load.
int receivedNumber = 5;
for (int pictureIndex = 0; pictureIndex < receivedNumber; pictureIndex++)
{
System::Windows::Forms::PictureBox^ pictureBox1 = (
gcnew System::Windows::Forms::PictureBox());
// set pictureBox1->Location and pictureBox1->Size here
}