Controls don't show over Winforms Host

你。 提交于 2019-12-11 03:56:28

问题


I am trying to load a swf file as background for my WPF window. For this I have used a WinformHost and I load the swf movie in the Winform host using the plugin AxShockwaveFlashObjects.

<Grid>
    <WindowsFormsHost Name="wfh">
        <ax:AxShockwaveFlash x:Name="axFlash"/>
    </WindowsFormsHost>
</Grid>

Till here the application works fine. However when I add my other controls(buttons,textblocks etc) to the Grid, they dont show. All I see is just the movie. Any pointers please.


回答1:


This is actually expected since the WPF elements are all rendered within a single HWND (that of the WPF Window in this case) and therefore are below the WindowsFormsHost (or any other HwndHost). This is discussed here in MS' documentation and also here.

In theory this will be supported by some new functionality being added to .NET 4.5 - via the IsRedirected property of the HwndHost. This is discussed in some of the preview documentation for 4.5 here.



来源:https://stackoverflow.com/questions/8006092/controls-dont-show-over-winforms-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!