private void btnLogin_Click(object sender, EventArgs e) { if (this.txtUser.Text == "admin" && this.txtPass.Text == "123") { this.Hide(); main MDIForm = new main(); MDIForm.Show(); } else { MessageBox.Show("Invalid User name or Password!"); } }
private void txtPass_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (this.txtUser.Text == "admin" && this.txtPass.Text == "123") { this.Hide(); main MDIForm = new main(); MDIForm.Show(); } else { MessageBox.Show("Invalid User name or Password!"); } } }