I have created pictureboxes dynamically in windows forms Application… its working well…
now i have to generate label boxes dynamically and that label boxes will display in bottom of the each picture box and that have to display the corressponding picturebox name…
how shall i do this? Give me the solution of this…
Thanks In Advance…
And My coding Is here..
int Left = this.Left+200;
int Top = this.Top;
for(int i=0;i<Num_Picbox;i++)
{
shapes[i] = new PictureBox();
shapes[i].Location = new Point(Left,Top);
Left += 200;
Top += i + 0;
shapes[i].Size = new Size(160,160);
shapes[i].BackColor = Color.Black;
shapes[i].Visible = true;
shapes[i].Name = i.ToString();
shapes[i].BorderStyle = BorderStyle.FixedSingle;
flowLayoutPanel1.Controls.Add(shapes[i]);
flowLayoutPanel1.WrapContents = true;
shapes[i].Click += new EventHandler(PictureBox_Click);
}
Create a panel for each picture that contains a label docked to
Bottomand your picture box docked toFill. Add this panel to the flow layout panel instead of your picture box. Make sure you add your picture box to the panel’s Controls collection first to ensure that the docking works as expected.