private void ButtonLogin_Click(object sender, RoutedEventArgs e) { if (UserName.Text.ToString().Equals("admin") && Pwd.Password.ToString().Equals("12345")) { WindowPrincipale windows = new WindowPrincipale(); windows.Show(); this.Close(); } else { i++; if (i < 3) { MsgError.Text = "Login or Password is incorrect"; } else if (i >= 3 && i < 5) { } else { MsgError.Text = "Vous avez fait plus de 4 essaies l'application va s'arreter WARNING !!!"; Application.Current.Shutdown(); } } }
private void ButtonClose_Click(object sender, RoutedEventArgs e) { WindowPrincipale windows = new WindowPrincipale(); windows.Show(); this.Close(); }