title: Delete a set of panels with UserControls created in a loop
body: <p>I created a panel with a button "add" and a button "delete". If you click on "add" a panel is created right below this header, you can create as much as you want, they are listed.</p>
  
  <p>On each panel there is a checkbox and I would like to delete the panel if the checkbox is checked once the button delete is clicked. </p>
  
  <p>I can get the intuition of a loop : for, but still too novice to get through this without a little tip. </p>
  
  <p>-</p>
  
  <pre><code>public partial class Test_auto : Form
  {
      ArrayList strategyFutureList = new ArrayList();
  
      public Test_auto()
      {
          InitializeComponent();
          Instance = this;
      }
  
      //Create a new future strategy
      public void CreateStrategyFuture()
      {
          ConsoleStrategyItem strategyItemFuture = new ConsoleStrategyItem();
          strategyItemFuture.Location = new Point(3, 3);
          futureContainer.Height += 85;
          strategyFutureList.Add(strategyItemFuture);
          futureContainer.Controls.Add(strategyItemFuture);
          ConsoleStrategyItem.Instance.txtStrategyName.Text = "Strat Future " + strategyFutureList.IndexOf(strategyItemFuture) + " ";
          ConsoleStrategyItem.Instance.Name = "strategyFuture" + strategyFutureList.IndexOf(strategyItemFuture);
          ConsoleStrategyItem.Instance.cbxDeleteStrategy.Name = "cbxDeleteFuture" + strategyFutureList.IndexOf(strategyItemFuture);
      }
  
      //Makes it appear
      private void btnAddStrategyFuture_Click_1(object sender, EventArgs e)
      {
          CreateStrategyFuture();
      }
  
      //Delete a-some selected strategies
      public void DeleteStrategyFuture()
      {
          for (int i = 0; i &lt; strategyFutureList.Count; i++)
          {
              if (ConsoleStrategyItem.Instance.cbxDeleteStrategy.Checked = true)
              {
              }
          }
      }
  
      private void btnDeleteStrategyFuture_Click(object sender, EventArgs e)
      {
          DeleteStrategyFuture();
      }
  }
  </code></pre>