I am designing a multi-page window shape using panels.
I show the login form and check the click of a button and want to hide the login panel and show the main panel.
However, when I click the button, the input panel disappears in order, but the main panel does not appear. since there is nothing to display, the form window shrinks to the Minimize / Maximize / Close buttons.
Here's the button code:
private void btn_login_Click(object sender, EventArgs e) { if (pwdBox.Text == optopwd) { MessageBox.Show("Good Morning!!"); loginpanel.Visible = false; mainpanel.Visible = true; } else { MessageBox.Show("Incorrect password!"); } pwdBox.Text = ""; }
Please let me know what I missed / misunderstood. Thanks!
Edit: Screenshots: Login screen: http://img641.imageshack.us/img641/9310/loginscreenj.jpg
Empty window: http://img163.imageshack.us/img163/1376/emptyx.jpg
source share