private void timer_tick(object sender, EventArgs e) { lockImage.Margin = new Thickness(42, 5, 0, 5); timer.Stop(); timerRunning = false; Wait1.SeekAlignedToLastTick(TimeSpan.FromSeconds(7)); if (status == Status.errorId) { MessageBox.Show("ID输入有误,请重试。"); } else if (status == Status.errorPassword) { MessageBox.Show("密码错误或未注册。"); } else if (status == Status.success) { winindex.Show(); this.Close(); return; } LoginBorder.Visibility = Visibility.Visible; TextBoxPId.Visibility = Visibility.Visible; TextBoxPassword.Visibility = Visibility.Visible; TextBoxPId.Focus(); }
private void Grid_Loaded_1(object sender, RoutedEventArgs e) { TextBoxPId.Focus(); }