ElementHost - empty when the window is reopened

I am working with a non-WPF application, so I can create custom WPF controls. My job for this was to simply create my windows as usercontrols, and then I created a common winform to host wpf user control (using ElementHost) to simulate a wpf window.

Everything works fine on my dev machine (WinXP VM), but on client computers (VM and Physical, like Windows 7) windows will open once and work fine. However, when he closes them and then opens them again, they are simply empty white. Windows are closed and deleted after each closing (the same thing happened even if I left them in my memory). The client must close the application and run it again to see the windows again.

I tried adding update calls and something that does not use elementhost, but nothing works. Any ideas?! This happens in every window.

+3
source share
1 answer

Sorry to post this as an answer, as I don’t have permission to just comment. But I have some questions or possible directions for study.

Have you tried to see what happens by adding a debugger? Is he still receiving input events or redrawing events, or was he hanging? Does your WPF user control even loading when the window is reopened? Oh, and do not forget to also exclude the first random exceptions, perhaps this is a problem with WPF + CLR, and it does not even have the ability to boot again.

Does Spy ++ talk about child windows that could tell you what's going on?

, Win 7- ?

, , ? ?

, , ?

- , , , , - . http://www.switchonthecode.com/tutorials/wpf-tutorial-using-wpf-in-winforms

+3

Source: https://habr.com/ru/post/1789802/


All Articles