2

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.

H.B.
  • 166,899
  • 29
  • 327
  • 400
Karthik
  • 990
  • 10
  • 19

1 Answers1

5

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.

AndrewS
  • 6,054
  • 24
  • 31
  • IsRedirected was only available in Beta, did't make it to final release. – watbywbarif Jul 24 '15 at 10:21
  • As @watbywbarif mentioned the IsRedirected feature was cut so HwndHosts like WindowsFormsHost will always be above WPF elements. If you needed something floating above or something then maybe you can use a Popup as that is a separate top level (topmost) window but you won't get a sibling WPF element above the HwndHost. – AndrewS Oct 01 '18 at 15:59