在 WPF 窗口中按 Enter 键登录。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21361525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Pressing Enter Key to Login in WPF windows.
提问by Gawjus Gurl
I know that assigning the button to the AcceptButton property in a form would allow me to submit the form in Windows Forms. The problem I'm having is that I'm using a WPF Window as the login screen and I don't know how to make the button work when the Enter Key is pressed. There isn't an AcceptButton Property for WPF Windows. Any Help?
我知道将按钮分配给表单中的 AcceptButton 属性将允许我在 Windows 窗体中提交表单。我遇到的问题是我使用 WPF 窗口作为登录屏幕,但我不知道如何在按下 Enter 键时使按钮工作。WPF Windows 没有 AcceptButton 属性。任何帮助?

