title: How can I remove the previous Buttons after clicking on another one?
body: <p>I'm developing a project that requires a great amount of buttons. But I need for some button to remove previous ones. For example, when I click on the first button in stage 1, I want it to remove itself and the other one on stage 1, while the ones in stage 2 show up. I'm trying this apart from my actual project because I already tried with queues, lists and tuples.</p>
  
  <p>How can I do this? Looks pretty simple, but it's been really complicated achieving this. The code compiles, when I click a button, the others show up, but I can't remove them or make them not visible. How can I do this? Thanks in advance!  </p>
  
  <pre><code>//Creates buttons on stage one
  
          for (int i = 0; i &lt; 2; i++)
          {
              Button button = new Button();
              button.Location = new Point(20, 30 * i + 10);
              button.Visible = true;
              button.Text = "stage1";
  
              switch (i)
              {
                  case 0:
                      button.Click += new EventHandler(ButtonClick);
                      break;
                  case 1:
                      button.Click += new EventHandler(ButtonClick2);
                      break;
              }
  
              this.Controls.Add(button);
          }
      }
  
      void ButtonClick(object sender, EventArgs e)
      {
          // First Button Clicked
          // Creates buttons on stage 2
  
          for (int i = 0; i &lt; 2; i++)
          {
              Button button = new Button();
              button.Location = new Point(200, 30 * i + 10);
              button.Visible = true;
              button.Text = "stage2";
  
              switch (i)
              {
                  case 0:
                      button.Click += new EventHandler(ButtonClick3);
                      break;
                  case 1:
                      button.Click += new EventHandler(ButtonClick4);
                      break;
              }
              this.Controls.Add(button);
          }
      }
      void ButtonClick2(object sender, EventArgs e)
      {
          // Second Button Clicked
      }
  
      void ButtonClick3(object sender, EventArgs e)
      {
          // Third Button Clicked
      }
  
      void ButtonClick4(object sender, EventArgs e)
      {
          // Fourth Button Clicked
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6Tx8N.png" alt="Visual Representation of the buttons"></p>