private void Loginbutton_Click(object sender, EventArgs e) { string mail = usernbox.Text; string password = passbox.Text; if (usermethods.validation(mail, password)) { openingwindow.loggeduserid = usermethods.getUser(mail); openingwindow.successfullogin = true; continueasadmin con = new continueasadmin(); if (usermethods.isadmin(mail)) { con.ShowDialog(); } logged logged = new logged(); logged.ShowDialog(); Close(); } else { MessageBox.Show("Mail or password is incorrect!"); } }