diff --git a/Sleep-Timer/MainWindow.xaml b/Sleep-Timer/MainWindow.xaml index cd6fc20..78e3424 100644 --- a/Sleep-Timer/MainWindow.xaml +++ b/Sleep-Timer/MainWindow.xaml @@ -20,7 +20,7 @@ - + diff --git a/Sleep-Timer/MainWindow.xaml.cs b/Sleep-Timer/MainWindow.xaml.cs index 98484f9..de0413f 100644 --- a/Sleep-Timer/MainWindow.xaml.cs +++ b/Sleep-Timer/MainWindow.xaml.cs @@ -41,6 +41,7 @@ public partial class MainWindow : Window public MainWindow() { InitializeComponent(); + rdbtnSleep.IsChecked = true; } private void btnStart_Click(object sender, RoutedEventArgs e) @@ -50,6 +51,7 @@ private void btnStart_Click(object sender, RoutedEventArgs e) if(command == "error") { MessageBox.Show("Failed to set command!"); + return; } int minutes = 0; @@ -124,6 +126,14 @@ private void txtboxMinutes_LostFocus(object sender, RoutedEventArgs e) txtboxMinutes.Text = "Enter time in minutes"; } } + + private void txtboxMinutes_KeyUp(object sender, KeyEventArgs e) + { + if(e.Key == Key.Enter) + { + btnStart_Click(sender, e); + } + } }