From 033c8a4e332cb997d8378c7a7e41d42ff0043b2e Mon Sep 17 00:00:00 2001 From: handefeng <1030428966@qq.com> Date: Fri, 17 Jan 2025 17:07:55 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20login=E5=9B=9E=E8=BD=A6=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LoginWindow.xaml | 3 ++- LoginWindow.xaml.cs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/LoginWindow.xaml b/LoginWindow.xaml index 5ec57f7..ba7cdd6 100644 --- a/LoginWindow.xaml +++ b/LoginWindow.xaml @@ -10,7 +10,8 @@ AllowsTransparency="True" Background="Transparent" ResizeMode="NoResize" - Title="LoginWindow" Height="450" Width="450"> + Title="LoginWindow" Height="450" Width="450" + KeyDown="PasswordBox_KeyDown"> <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown"> <Border CornerRadius="20" BorderThickness="1" diff --git a/LoginWindow.xaml.cs b/LoginWindow.xaml.cs index 82db0a4..5ae565a 100644 --- a/LoginWindow.xaml.cs +++ b/LoginWindow.xaml.cs @@ -200,4 +200,11 @@ public partial class LoginWindow : Window } return password; } + private void PasswordBox_KeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Enter) + { + ConfirmButton_Click(sender, new RoutedEventArgs()); + } + } } \ No newline at end of file