private void login_Button_Click(object sender, EventArgs e) { using (_context = new HairSpaContext()) { if (ActiveUser.AreCredentialsValid(_context, username_TextBox.Text, password_TextBox.Text)) { var main_Form = new Main_Form(); main_Form.LogoutClicked += new EventHandler(main_Form_LogoutClicked); main_Form.Show(); username_TextBox.Text = ""; password_TextBox.Text = ""; this.Hide(); } } }