title: Can't set .Net panel to visible
body: <p>I am designing a multipage windows form using panels.</p>
  <p>I'm displaying a login form and validating the button click, and want to hide the login panel and show the main panel.</p>
  <p>However, when I click the button, the login panel disappears alright, but the main panel does not appear. since there is nothing to display, the form window shrinks to just the minimize/maximize/close buttons.</p>
  <p>Here's the code for the button:</p>
  <pre><code>private void btn_login_Click(object sender, EventArgs e)
  {
      if (pwdBox.Text == optopwd)
      {
          MessageBox.Show(&quot;Good Morning!!&quot;);
          loginpanel.Visible = false;
          mainpanel.Visible = true;
      }
      else MessageBox.Show(&quot;Incorrect password!&quot;);
  
      pwdBox.Text = &quot;&quot;;      
  }
  </code></pre>
  <p>Please let me know what I have missed/misunderstood. Thanks!</p>
  <p>Edit:
  Screenshots:
  Login Screen:
  <a href="http://img641.imageshack.us/img641/9310/loginscreenj.jpg" rel="nofollow noreferrer">http://img641.imageshack.us/img641/9310/loginscreenj.jpg</a></p>
  <p>Empty window:
  <a href="http://img163.imageshack.us/img163/1376/emptyx.jpg" rel="nofollow noreferrer">http://img163.imageshack.us/img163/1376/emptyx.jpg</a></p>