I am trying to remove textboxes and labels one by one by pressing a button.
I have a list of textboxes called inputTextBoxes.

Here is the code for adding :

```
private void onClickAdd(object sender, EventArgs e)
    {
        inputTextBoxes = new List<TextBox>();
        Label label1 = new Label();
        label1.Name = "label1";
        label1.Text = "w" + i;
        label1.Location = new System.Drawing.Point(5, 10 + (20 * i));
        label1.Size = new System.Drawing.Size(30, 20);
        this.Controls.Add(label1);

            TextBox text1 = new TextBox();
            text1.Name = "text1";
            text1.Location = new System.Drawing.Point(35, 10 + (20 * i));
            text1.Size = new System.Drawing.Size(25, 20);
            inputTextBoxes.Add(text1);
            this.Controls.Add(text1);
            i++;
    }

```

For removing I am trying this :

```
 private void onClickRemove(object sender, EventArgs e)
    {
       foreach(TextBox text1 in inputTextBoxes)
        {
            this.Controls.Remove(text1);
        }

    }

```

But it removes only the last textbox added,clicking againg on the button doesn't do anything.