Creating Dynamic User Interface Using ArrayList
<p>I am creating program which adds certain items to catalogue, I send all the items from <strong>library form</strong> to <strong>catalogue form</strong>. Each time I click add button new item appears in catalogue form. Also each item detail is saved in <strong>ArrayList NewItem</strong> and consequently added to static class <strong>Item</strong>.</p>

<p>All items are added programmatically to <strong>Catalogue form</strong>, however each time I add new item it overwrites the previous so that catalogue form looks similar as in picture, except it more like this:</p>

<blockquote>
  <p>Rambo 1</p>
  
  <p>Rambo 1</p>
  
  <p>Rambo 2</p>
</blockquote>

<p>Any advice?</p>

<p>This is sample of code which adds the new items.</p>

<pre><code>ArrayList hello = new ArrayList();

// NewItem is ArrayList into which all the item details are originally added

private void addItem(ArrayList NewItem)
{
    foreach (object obj in NewItem)
    {
        Item st = (Item)obj;
        String iname= st.IName.ToString();

        int helloe = hello.Count;
        for (int i = 0; i &lt; helloe ; i++)
        {
            hello.Add(new Label());
            System.Drawing.Point p = 
                new System.Drawing.Point(35, 120+ helloe * 25);

            (hello[helloe] as Label).Location = p;
            (hello[helloe] as Label).Size = new System.Drawing.Size(80, 20);

            (hello[helloe] as Label).Text = iname.ToString();

            Catalouge.Controls.Add(hello[helloe] as Label);
</code></pre>

<p><img src="http://i.stack.imgur.com/xo6No.png" alt="sample form"></p>
