using System; using System.Windows; using System.Windows.Input; using System.Windows.Threading; namespace CodeTesting { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DispatcherTimer CurrentTimeTimer = new DispatcherTimer(); CurrentTimeTimer.Interval = TimeSpan.FromSeconds(0.1); CurrentTimeTimer.Tick += CurrentTimeTimer_Tick; CurrentTimeTimer.Start(); } public void CurrentTimeTimer_Tick(object sender, EventArgs e) { DateTimeLabel.Content = DateTime.Now.ToString("hh:mm:ss tt"); } private void PasswordInput_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { MessageBox.Show("vaildating"); } } } }
KeyEventArgs
Key
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)