private void login_Click(object sender, RoutedEventArgs e) { if (username.Text == "admin" && mdp.Password == "123456") { MenuWindow menu = new MenuWindow(); menu.Show(); this.Close(); } else { error.Content = "*Username or Password INCORRECT ! "; } }
private void Window_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { if (username.Text == "admin" && mdp.Password == "123456") { MenuWindow menu = new MenuWindow(); menu.Show(); this.Close(); } else { error.Content = "*Username or Password INCORRECT ! "; } } }