Skip to content

Dynamically create controls

Jo Ju

Asked May 3, 2006, 2:57 PM EDT1 answer
Share
LinkedInX

Hi there,

I am working on creating a dynamic control which displays a collection of images.

I want to display 4 images per rows and the rows must be calculated based on the number of images.

For example if we have nine images in the collections there should be 3 rows and four images per row.

So i want to creat the rows and columns dynamically and load the images also dynamically. \

How do i go about.

Thanx in advance,

Jo

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • +1
    Here is the code
    //You can create a imageBox
    public void AddImage_buttonClick(object sender ,SystemEventArgs e)
    {
    int i=0;
    ImageBox image1=new ImageBox();
    image1.Location=new Point(0,i+=20);
    this.Controls.Add(Image1);
    }
    +1