title: Windows form C# change user control by code
body: <p>I have a windows form and i dont want to make any other windows forms just one windows form and different user controls how can i change between user controls for example hide one and show the other user control programmatically ?</p>
  
  <hr>
  
  <pre><code>private void Btt_info_Click(object sender, EventArgs e)
  {
      Frm_Main frm_main = new Frm_Main();
      frm_main.Controls["panel1"].Controls.Clear();
      UC_Info uc_info = new UC_Info();
      frm_main.Controls["panel1"].Controls.Add(uc_info);
  }
  </code></pre>
  
  <p>i added this but it doesnt work</p>