private void Timer_Counter(object sender, EventArgs e) { if (rbnQRmode.IsChecked.Value) { txtQRtoreadandfind.Focus(); } if (count_down < (count_down_started / 2) && count_down > 15) { lblCounter.Content = count_down.ToString() + " s"; lblCounter.Background = new SolidColorBrush(Colors.Yellow); } if (count_down < 15) { lblCounter.Content = count_down.ToString() + " s"; lblCounter.Background = new SolidColorBrush(Colors.Red); } else { lblCounter.Content = count_down.ToString() + " s"; } count_down--; if (count_down < 0) { Timer_couter.Stop(); System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath); // to start new instance of application this.Close(); //to turn off current app } }
private void btnpassconfirm_Click(object sender, RoutedEventArgs e) { if (dataBaseManager.confirmadminuser(txtUser.Text.ToUpper(), txtPass.Password.ToString())) { Timer_couter.Stop(); EditItems win_Edit = new EditItems(); win_Edit.ShowDialog(); txtUser.Clear(); txtPass.Clear(); Refresh_bindedData(); count_down = count_down_started; Timer_couter.Start(); } else { txtUser.Clear(); txtPass.Clear(); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { Timer_couter.Stop(); System.Diagnostics.Process.Start(System.Windows.Forms.Application.ExecutablePath); // to start new instance of application this.Close(); //to turn off current app }