title: WinForm method does not have access to panel properties
body: <p>I'm trying to make a <code>WinForm</code> app with a expandable menu. I'm trying to create a method that will change a panel propierties in <code>form1</code> but it sees the value as false even if it is not? I got message box with "recognition as false". Instead of code I would rather a nice explanation</p>
  
  <pre><code>private void JobSelectButton_Click(object sender, EventArgs e)
  {
      //button to open a panel with "menu"
      if (jobPanel.Visible == false)
      {
          // the panel is visible from this point
          jobPanel.Visible = true;
      }
      else
      {
          jobPanel.Visible = false;
      }            
  }
  
  public void fla(bool flag)
  {   //method inside form1 and it should make jobPanel.Visible = false             
      if (jobPanel.Visible == false)
          MessageBox.Show("recognition as false");
      else jobPanel.Visible = false;
  }
  
  private void notification_MouseClick(object sender, MouseEventArgs e)
  {   // user control that will call the method
      caseNBvalue = lbl_caseNB.Text;
      profile f2 = new profile();
  
      f2.fla(true);
  }
  </code></pre>