views:

316

answers:

2

Is there a way to find the HTML element on the page that a Silverlight control is hosted in from within Silverlight?

A: 

Use firefox and install FireBug

Then use the 'inspect' button and highlight the silverlight portion of the page. This should automatically show you the HTML for that portion of the page and show you the element which is containing the silverlight control.example doing this for flash below - or directly linked here: http://mikesingleton.net/images/firebug_ex.png since the embed doesn't seem to be working

msingleton
I think he wants to find it at runtime...
Boyan
+2  A: 

Use this:

System.Windows.Browser.HtmlElement plugin = System.Windows.Browser.HtmlPage.Plugin;
Boyan