I have a winforms usercontrol with multiple buttons in a WPF Control.
My usercontrol was previously hosted in a windows form and I was able to so
this.ParentForm.AcceptButton = this.btnSearch;
I'm trying to establish how to do similar on the usercontrol now that it is in the WindowsFormHost. The ParentForm property is null.
There are two things I would ideally like to achieve.
Many thanks, Chris
Set Button.IsCancel (Esc) or IsDefault (Enter) on the Buttons in the page.
Example:
<Button Content="Yes" Click="Yes_Button_Click" IsDefault="True"/>
<Button Content="No" Click="No_Button_Click" IsCancel="True"/>
Set your default button's IsDefault property to true.
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