title: call method in form from usercontrol
body: <p>In usercontrol I have some objects(<code>textbox</code>,<code>combobox</code>,etc) . In the form,I have a button that shows or hide some objects from usercontrol. I am trying to call the method from usercontrol but it doesn't work. My code:</p>
  
  <p>usercontrol:</p>
  
  <pre><code>public void MinimMaxim()
  {
      _txtName.Visible = true;
      _txtPackage.Visible = true;
      _panelButton.Visible = false;
      _txtBody.Visible = false;
      _btnPlus.Visible = false;
  } 
  </code></pre>
  
  <p>and in form:</p>
  
  <pre><code>//method that creates taskcontrols at every button click
  private void _buttonAdd_Click(object sender, EventArgs e)
  {
      TaskControl task= new TaskControl();
  }
  //call function from usercontrol
  private void button_Click(object sender, EventArgs e)
  {
      task.MinimMaxim = true;
  }
  </code></pre>