title: I would like to control Form1 from Form2
body: <p>So I want basically the user to login in first in order to use the other form. However, my dilemma is that the login box is in Form2, and the main form is Form1.</p>
  
  <pre><code>if ((struseremail.Equals(username)) &amp;&amp; (strpasswd.Equals(password)))
  {
    MessageBox.Show("Logged in");
    form1.Visible = true;
    form1.WindowState = FormWindowState.Maximized;
  }
  else
  {
    MessageBox.Show("Wow, how did you screw this one up?");
  }
  </code></pre>
  
  <p>However, Form1 doesn't become visible, (since I launch it as visble = false) after they log in. Can someone help?</p>
  
  <p>EDIT:</p>
  
  <p>Brilliant response, but my problem is still here. I basically want to load Form2 First, (which is easy I run Form1 and set it to hide) But when Form2 is closed, I want Form1 to be closed as well.</p>
  
  <pre><code>private void Form2_FormClosing(Object sender, FormClosingEventArgs e)
  {
    Form1 form1 = new Form1();
    form1.Close();
    MessageBox.Show("Closing");
  }
  </code></pre>
  
  <p>this doesn't seem to work...</p>