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 3496904
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:18:22+00:00 2026-05-18T12:18:22+00:00

I have created a simple silverlight application to display some text at realtime from

  • 0

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:

<Grid x:Name="LayoutRoot">
        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top">
            <Button x:Name="topContinue" Content="Continue" Margin="0,30,30,0" Click="Continue_Click"></Button>
        </StackPanel>
        <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom">
            <Button x:Name="bottomContinue" Content="Continue" Margin="0,0,30,30" Click="Continue_Click"></Button>
        </StackPanel>
</Grid>

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("&lt;", "<").Replace("&gt;", ">");
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

  • 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-05-18T12:18:22+00:00Added an answer on May 18, 2026 at 12:18 pm

    I have taken a look at your code and as I suspected its not Silverlight that seems to be the issue but more the implementation of CSS within the different browsers.

    To make this work in both browsers you either need to remove the following line of code:

    isilverlightControlHost.SetStyleAttribute("position", "absolute");
    

    Or amend the code so that the position style attribute is ignored by Firefox:

    isilverlightControlHost.SetStyleAttribute("position", "absolute !important");
    

    I have tried this on my machine using IE8 and FF3.6.12 and the Continue buttons are visible in both when this code line is changed.

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

Sidebar

Related Questions

No related questions found

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.