private void loginButton_Click(object sender, EventArgs e) { userName = Convert.ToString(nameTextBox.Text); userPassword = Convert.ToString(passwordTextBox.Text); if (Form1.correctName == userName && Form1.correctPassword == userPassword) { Form ls = this.FindForm(); ls.Controls.Remove(this); Second_Screen ss = new Second_Screen(); ls.Controls.Add(ss); } else { errorLabel.Text = "Incorrect username and/or password."; } }