private void btnLogin_Click(object sender, EventArgs e) { if (users.confirmLogin(txtUser.Text, txtPass.Text)) { Users user = users.getUserByName(txtUser.Text); user.Bank = cbank.getBankByUser(user.User); SUsers.setInstance(user); Principal principal = new Principal(); Hide(); principal.ShowDialog(); } else { MessageBox.Show("there is no user with this password or user", "there is an error:"); } }