title: Hiding/blocking tabs using windows forms in c#
body: <p>The thing is that i have a 'log in window' and a 'mainwindow' that is called after pressing the log in button or the "VISITANT" button</p>
  
  <p>If pressing the log in button, the whole system will come out, and if i press the VISITANT button, one tab should disappear or be blocked or something.</p>
  
  <pre><code>private void visitant(object sender, EventArgs e)
  {
          mainwindow menu = new mainwindow();
          menu.Show();
  
          //mainwindow.tabPage1.Enabled = false; //attempt1
          //mainwindow.tabPage1.Visible = false; //attempt1
  
          //System.Windows.Forms.tabPage1.Enabled = false;//attempt2
          //System.Windows.Forms.tabPage1.Visible = false;//attempt2
  
          this.Hide();
  }
  </code></pre>
  
  <p>the errors i get for using the attempt1 are</p>
  
  <p>Error   1   'System.mainwindow.tabPage1' is inaccessible due to its protection level'<br>
  Error   2   An object reference is required for the non-static field, method, or property 'System.mainwindow.tabPage1'  </p>
  
  <p>and the one i get for using the attempt2 is</p>
  
  <p>Error   1   The type or namespace name 'tabPage1' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)   </p>
  
  <p>as you probably have guessed "tabPage1" is the tab i need to hide when pressing the visitant button.</p>
  
  <p>I can't think of any more details, I will be around to provide any extra information</p>
  
  <p>Thanks in advance.</p>