private void TB_personnummer_TextChanged(object sender, TextChangedEventArgs e) { if (TB_personnummer.Text.Length == 6) { TB_personnummer.Text += "-"; TB_personnummer.SelectionStart = TB_personnummer.Text.Length; } if (TB_personnummer.Text.Length == 11) { TB_password.Focus(); } }
private void B_logind_Click(object sender, RoutedEventArgs e) { Logic logic = new Logic(); if (logic.checkLogin(TB_personnummer.Text, TB_password.Password) == true) { //Thread.Sleep(3000); //MainWindow MW = new MainWindow(); //MW.Show(); this.Close(); Application.Current.MainWindow.Show(); } else { MessageBox.Show("Forkert ID eller password \n Prøv igen"); TB_password.Clear(); TB_personnummer.Clear(); TB_personnummer.Focus(); } }