Windowsless property is not working in Firefox ONLY

Posted by lmenaria on Stack Overflow See other posts from Stack Overflow or by lmenaria
Published on 2010-04-14T13:31:18Z Indexed on 2010/04/14 13:33 UTC
Read the original article Hit count: 368

Filed under:
|

Hello,

I have created a simple silverlight application to display some text at realtime from xml. The text display using HTML DIV tag. I have added plugin property windowless=true, enablehtmlaccess=true,background=transparent.

On Silverlight I have added a Button "Continue" at Top & Bottom, which shows some message on that click.

Silverlight Plugin resize based in XML contents.

My code :

MainPage.xaml:

MainPage.xaml.cs:

Creating HTML DIV on Application Start using :

HtmlDocument _document = HtmlPage.Document; HtmlElement iDIV = _document.CreateElement("DIV"); iDIV.SetAttribute("id", "divHTMLViewer"); iDIV.SetStyleAttribute("position", "absolute"); iDIV.SetStyleAttribute("z-index", "1"); iDIV.SetStyleAttribute("display", "INLINE"); iDIV.SetStyleAttribute("top", "100px"); iDIV.SetStyleAttribute("height", "0px"); iDIV.SetStyleAttribute("width", "96%"); iDIV.SetStyleAttribute("left", "15px"); iDIV.SetStyleAttribute("text-align", "justify");

HtmlElement body = _document.GetElementsByTagName("BODY")[0] as HtmlElement; body.RemoveChild(iDIV); body.AppendChild(iDIV);

Set the XML text :

HtmlElement divHTMLViewer = HtmlPage.Document.GetElementById("divHTMLViewer"); sText = sText.Replace("<", "<").Replace(">", ">"); divHTMLViewer.SetStyleAttribute("display", "none"); divHTMLViewer.SetStyleAttribute("width", "96%"); divHTMLViewer.SetStyleAttribute("top", "100px"); divHTMLViewer.SetStyleAttribute("left", "15px"); divHTMLViewer.RemoveStyleAttribute("color"); divHTMLViewer.RemoveStyleAttribute("fontSize"); divHTMLViewer.SetProperty("innerHTML", sText); divHTMLViewer.SetStyleAttribute("display", "INLINE"); setSilverlightControlHeight(UILAYOUT.INSTRUCTIONS);

Silverlight Plugin size increase code :

isilverlightControlHost.SetStyleAttribute("height", HtmlPage.Window.Eval("document.documentElement.scrollHeight").ToString() + "px"); isilverlightControlHost.SetStyleAttribute("position", "absolute");

All these code is working fine in Internet Explorer, Crome & Safari but "Continue" not visible in FIREFOX ONLY.

So is there any issue with this code ?

Code Sample :http://lm-bucket-for-forum-post.s3.amazonaws.com/HtMLViewerSilverLight.zip

working sample : Just replace ".zip" with "TestPage.html" in above URL.

Please let me know how can I solve it ?

Thanks in advance, Laxmilal Menaria

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about windowless