private void btnLogin_Click(object sender, EventArgs e) { ValidateChildren(ValidationConstraints.Enabled); if (!string.IsNullOrEmpty(tbUsername.Text)) if (!string.IsNullOrEmpty(tbPass.Text)) { if (LoginCheck()) { _frmSalesManage f = new _frmSalesManage(); this.Hide(); f.ShowDialog(); this.Show(); } } }
private void tbUsername_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { ValidateChildren(ValidationConstraints.Enabled); if (!string.IsNullOrEmpty(tbUsername.Text)) if (!string.IsNullOrEmpty(tbPass.Text)) { if (LoginCheck()) { _frmSalesManage f = new _frmSalesManage(); this.Hide(); f.ShowDialog(); this.Show(); } } } }