Create Objects in panel and arrange objects the new in first not in end
I want create manually PictureBox and Label on horizontal Panel, The count
of PictureBox and Label on panel Unknown maybe 200 or more or less, I use
the below code to do that but i face two troubles first one: I want add
the new object created in the first not in the end for example if i
created items "A B C D E" want it add on Panel "E D C B A" want always the
new come to first. Note: Panel width "230" Height "710" Second trouble:
Currently when i use Panel scroll bar to go down than add new objects find
happen big free space between the last object created and the new and if i
used scroll again to go down and created new object on panel happen more
big free space.
int Right = 50, Top = 0;
// Create Image + Text
PictureBox pbox = new PictureBox();
pbox.Size = new Size(140, 80);
pbox.Location = new Point(Right, Top);
pbox.Image = Image.FromFile("");
Panel1.Controls.Add(pbox);
// Create label
Label lblPlateNOBAR = new System.Windows.Forms.Label();
lblPlateNOBAR.Text = lblPlateNO.Text;
lblPlateNOBAR.Location = new Point(Right + 20, Top + 80);
Panel1.Controls.Add(lblPlateNOBAR);
Top = Top + 150;
No comments:
Post a Comment