private void btLogin_Click(object sender, EventArgs e) { if (lc.check(tbUsername.Text, tbPassword.Text)) { DBForm dbf = new DBForm(this, tbUsername.Text); this.Hide(); dbf.Show(); allClear(); //to clear login details when unhiding this login form } else { lblFail.Visible = true; allClear(); } }