dynamic pictureBox creation
-
Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?
-
Hi all, I have a form that contains one button and one textbox, the textbox will take a number that will be passed to another form. I have done this successfully. The thing is that I need the second form to create a number of pictureboxes = the number received from the first form. Any ideas?
call: gcnew PictureBox() for each. Then set the Image and other properties as desired.
-
call: gcnew PictureBox() for each. Then set the Image and other properties as desired.
Hi kilroytrout, I have done this in the Form_load as follows:
pictureBoxX = gcnew System::Windows::Forms::PictureBox(); pictureBoxX->Location = System::Drawing::Point(24, 262); pictureBoxX->Name = L"pictureBoxX"; pictureBoxX->Size = System::Drawing::Size(45, 49); pictureBoxX->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; pictureBoxX->Image = Drawing::Image::FromFile("avg.jpg");
but nothing appears in the form :confused: -
Hi kilroytrout, I have done this in the Form_load as follows:
pictureBoxX = gcnew System::Windows::Forms::PictureBox(); pictureBoxX->Location = System::Drawing::Point(24, 262); pictureBoxX->Name = L"pictureBoxX"; pictureBoxX->Size = System::Drawing::Size(45, 49); pictureBoxX->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; pictureBoxX->Image = Drawing::Image::FromFile("avg.jpg");
but nothing appears in the form :confused:Did you add each PictureBox to the form's control collection? form->Controls->Add(pictureBoxX);
-
Did you add each PictureBox to the form's control collection? form->Controls->Add(pictureBoxX);
Hi kilroytrout, you helped alot thanks,