Question

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.

  1. AcceptButton behaviour (Enter key triggers button press)
  2. AcceptButton formatting - i.e. the winforms button has the alternate formatting for accept buttons applied.

Many thanks, Chris

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top