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?
Set IsDefault to True
.
<Button IsDefault="True"/>
From MSDN:
Gets or sets a value that indicates whether a Button is the default button. A user invokes the default button by pressing the ENTER key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With