F
F
Flaker2014-04-19 17:55:57
WPF
Flaker, 2014-04-19 17:55:57

(C#, VS10) WPF element on WinForm blocks KeyDown event

Introduction:
I started writing a WinForms application, a little later I learned about WPF ( I don't want to rewrite it ), I began to integrate WPF controls into a WinForm application.
Essence:
Created a WPF User Control in the designer.
I dynamically add a control to the form via ElementHost .
In the Form_Load event :
I create a new UserControl
I create a new ElementHost , its parent is form , child is UserControl .
KeyDown form event stops working.
Tried to doform.focus() didn't help.
If you do not set the parent of ElementHost , then everything is fine.
Tell me how to make the event work normally, even if the ElementHost has a parent?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question