Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8315087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:02:41+00:00 2026-06-08T21:02:41+00:00

I have a SWF object embedded in a WindowsFormsHost Control inside a WPF window.

  • 0

I have a SWF object embedded in a WindowsFormsHost Control inside a WPF window.

I’d like to add a toolbar over the swf movie.

The problem with the snippet of code I have below, is that when the new child is added to the host control (or the movie is loaded, I haven’t figured out which yet), the toolbar is effectively invisible. It seems like the z-index of the swf is for some reason set to the top.

Here is what it looks like:

XAML:

<Grid Name="Player">
   <WindowsFormsHost Name="host" Panel.ZIndex="0" />
   <Grid Name="toolbar" Panel.ZIndex="1" Height="50"
      VerticalAlignment="Bottom">
           [play, pause, seek columns go here]
   </Grid>
</Grid>

C#:

private void Window_Loaded(object sender, RoutedEventArgs e)
{
   flash = new AxShockwaveFlashObjects.AxShockwaveFlash();
   host.Child = flash;
   flash.LoadMovie(0, [movie]); // Movie plays, but no toolbar :(
}

Any insight on this issue would be much appreciated.


Update: Since no suitable answer was posted, I’ve placed my own solution below. I realize this is more of a hack than a solution so I’m open to other suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:02:42+00:00Added an answer on June 8, 2026 at 9:02 pm

    Another solution I’ve discovered is to use Windows Forms’ ElementHost control. Since I’m using a Windows Form inside a WPF window anyway, why not just use an entire Windows Form and save myself Z-Issue headaches.

    The ElementHost control is really useful, because I can still use my toolbar UserControl, and embed it inside the Windows Form. I’ve discovered that adding a child can be finicky with Windows Forms, so here’s a snippet describing the solution:

    First, toss in the ActiveX object, then an ElementHost Control, using the designer.

    Form1.Designer.cs:

    private AxShockwaveFlashObjects.AxShockwaveFlash flash;
    private System.Windows.Forms.Integration.ElementHost elementHost1;
    

    Form1.cs

    public Form1(string source)
    {
         InitializeComponent();
         toolbar = new UserControl1();
         this.elementHost1.Child = this.toolbar;
         this.flash.LoadMovie(0, source);
    }
    

    Note that the child was not set in the designer. I found that for more complex UserControls the designer will complain (though nothing happens at runtime).

    This solution is, of course, still not entirely ideal, but it provides the best of both worlds: I can still code my UserControls in XAML, but now I don’t have to worry about Z-indexing issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to place a flash video (object, swf) inside a div, and have
Say I have an flash object embedded in XHTML like so... <object width=600 height=400>
I have a website that communicates with an embedded swf object. The flash runs
I have a swf that I would like to cookie to control the frame
We have a Rails app that instantiates a SWF object 16 times (it has
I have a web page with swf file defined this way <object width=600 height=400
I have one swf object in my site. I have to read data from
I have a Facebook Canvas iframe app. In that, I have a SWF object
Here's the challenge: I have a Flash movie which will be embedded in a
I have a embedded image in an html document like this <div id =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.