hello,
i have a panel.
i add label and a pictureBox using this :
Code:
private void AddLabelAndImage(ref Point startPoint, string labelText, System.Drawing.Image image)
        {
            Label label = new Label();
            panel1.Controls.Add(label);
            label.Text = labelText;
            label.Name = "text";
            label.Width = 100;
            label.Height = 30;
            label.Location = startPoint;
            startPoint.Y += label.Height;

            System.Windows.Forms.PictureBox box = new PictureBox();
            panel1.Controls.Add(box);
            box.Name = "image";
            box.Size = image.Size;
            box.Image = image;
            box.Location = startPoint;
            startPoint.Y += box.Height + 10;

what i want is to retrieve the picturebox control as System.Windows.Forms.PictureBox.
every function like find() returns Control[]

how to do this??
 

Zangetsu

I am the master of my Fate.
hello,
i have a panel.
i add label and a pictureBox using this :
Code:
private void AddLabelAndImage(ref Point startPoint, string labelText, System.Drawing.Image image)
        {
            Label label = new Label();
            panel1.Controls.Add(label);
            label.Text = labelText;
            label.Name = "text";
            label.Width = 100;
            label.Height = 30;
            label.Location = startPoint;
            startPoint.Y += label.Height;

            System.Windows.Forms.PictureBox box = new PictureBox();
            panel1.Controls.Add(box);
            box.Name = "image";
            box.Size = image.Size;
            box.Image = image;
            box.Location = startPoint;
            startPoint.Y += box.Height + 10;
what i want is to retrieve the picturebox control as System.Windows.Forms.PictureBox.
every function like find() returns Control[]

how to do this??

u r using a subroutine.....& adding label & picturebox in panel.....
but i didnt get ur question...u want to get the picturebox then u can use
panel.findcontrol() method......
 
Top Bottom