When implementing a new SilverLight custom control, it was blocking menu popups (html / javascript) on the page. I set the z-index of the div and object tags that contained SilverLight to no avail. After a lot of googling, I found the following solution.
Set the Windowless property to true. In the case of manually adding SilverLight to the page, that results in the following child tag of the object tag…
<param name="Windowless" value="true" />
Update: I recently read Professional Silverlight 4 (Wrox Programmer to Programmer) and highly recommend it for developers working with SilverLight. Used copies are pretty affordable.
Comments
9 responses to “SilverLight and Z-Index”
Thanks for the tip. You probably saved me an hour or two.
Thanks, this is great.. really helpful….
Thank you for this, it saved me a ton of time as the z-indexing was not working for me.
Matt
I have a similar issue with an XBAP. Can you provide some input to that. I came to this page from an answer to my query on stackoverflow http://stackoverflow.com/questions/2698183/wpf-issue-showing-html-div-on-top-of-wpf-app
I don’t have much experience with XBAP. Any reason you can’t migrate the app to Silverlight? It’s actually less restrictive of a client requirement. XBAP requires the .Net framework, while Silverlight just requires the client browser plugin.
Thank you for this, it saved my time.
Kishan
Wow. I was running into the exact same problem with my pop-up menus rendering behind my Silverlight control in Chrome and Safari. They rendered correctly in IE 8 and Firefox 3.6.8. Thanks so much for posting this as you saved me a lot of time and frustation.
thank you so much, you’re the man
Thank you very much I was having heck with an autocomplete textbox, the list kept getting hidden beneath my silverlight user control. I tried all sorts of things and this fixed my problem.