title: How to hide User control from another user control?
body: <p>I am working in an school project in C# but I have a problem. I made a user control in which i have some buttons, this is like a banner with buttons in it. Those buttons should SHOW and HIDE other User Controls</p>
  
  <p>Here is my code in the User Control that has the button:</p>
  
  <pre><code> Reports ra = new Reports();
   PurchaseReport rb = new PurchaseReport();
  </code></pre>
  
  <p>than in one of the button i wrote this code:</p>
  
  <pre><code> ra.Hide();
  
   rb.Show();
   this.Controls.Add(rb);
   rb.Location = new Point(130, 153);
  </code></pre>
  
  <p>But the problem is that it doesn't hide the Reports (ra). And it doesn't show the Purchase Report (rb). What is the problem? </p>
  
  <pre><code>public partial class MenuUserC : UserControl
  {
  
      Reports ra = new Reports();
      PurchaseReport rb = new PurchaseReport();
  
      public MenuUserC()
      {
          InitializeComponent();
      }
  
      private void ButtonItem15_Click(object sender, EventArgs e)
      {
          rb.Hide();
  
          ra.Show();
          this.Controls.Add(ra);
          ra.Location = new Point(130, 153);
      }
  
      private void ButtonItem1_Click(object sender, EventArgs e)
      {
  
          ra.Hide();
  
          rb.Show();
          this.Controls.Add(rb);
          rb.Location = new Point(130, 153);
  
      }
  </code></pre>