In my WPF xaml file, how do I make it so that my textbox uses the default button when I press the return key, but if I paste something in with more than 1 line, it pastes it all in. The AcceptsReturn parameter doesn’t let me use a default button. Is this possible?
Share
WPF doesn’t have similar support as in the WinForms
DialogResultproperty. If you want to do something when someone presses enter then you should override theOnKeyUpevent orOnPreviewKeyUpevent.The
AcceptsReturnproperty of theTextBoxclass just means that it will allow the user to press return and register a CRLF in the textbox (otherwise it ignores them).