Exemple #1
0
 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!");
     }
 }
Exemple #2
0
 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!");
         }
     }
 }