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?
sarah_malik wrote:
Any ideas?
You have not really asked any question! Creating Picture box is well documented in the MSDN
PictureBox picBox = new PictureBox();
picBox.Location = new Point(0, 0);
picBox.Size = new Size(10, 10);
picBox.TabStop = false;
picBox.SizeMode = PictureBoxSizeMode.StretchImage;
picBox.BorderStyle = BorderStyle.Fixed3D;
// Add the PictureBox to the form.
this.Controls.Add(picBox);and you can loop to the number required and create any many as you wish. If your question is on positioning of the picture boxes, then if you are using .NET 2 then consider using any of the Layout Panels objects like TableLayoutPanel. Best regards, Paul.
Jesus Christ is LOVE! Please tell somebody.
-
sarah_malik wrote:
Any ideas?
You have not really asked any question! Creating Picture box is well documented in the MSDN
PictureBox picBox = new PictureBox();
picBox.Location = new Point(0, 0);
picBox.Size = new Size(10, 10);
picBox.TabStop = false;
picBox.SizeMode = PictureBoxSizeMode.StretchImage;
picBox.BorderStyle = BorderStyle.Fixed3D;
// Add the PictureBox to the form.
this.Controls.Add(picBox);and you can loop to the number required and create any many as you wish. If your question is on positioning of the picture boxes, then if you are using .NET 2 then consider using any of the Layout Panels objects like TableLayoutPanel. Best regards, Paul.
Jesus Christ is LOVE! Please tell somebody.
Thank you Paul,