private void btnSignUp_Click(object sender, EventArgs e) { if (User.exists(txtUsername.Text)) { MessageBox.Show("The username is already in use, choose another one"); frmLogin_Load(new object(), new EventArgs()); } else { frmSignUp signup = new frmSignUp(); signup.typedUsername = this.txtUsername.Text; signup.typedPassword = this.txtPassword.Text; this.Hide(); signup.ShowDialog(); this.Show(); frmLogin_Load(new object(), new EventArgs()); } }