A fix for simple HTML display in Silverlight [HtmlTextBlock bug fix for Silverlight 2 RTW!]

This blog has moved to a new location and comments have been disabled.

All old posts, new posts, and comments can be found on The blog of dlaa.me.

See you there!

Comments (12)
  1. In this issue: Silverlight Girl, Mehdi Slaoui Andaloussi, David Anson, Cheryl, Justin Angel, Kathy Kam

  2. davidjjon77 says:

    Thank you very much for sharing this control David.

    One of the serious issues with Silverlight is SEO.  It seems to me that one way of effectively handling SEO is to have an invisible web site of html that only the search bots see – Silverlight could use a control like HtmlTextBlock to read and display appropriate portions of each invisible html page.  Anyway, that’s what I am implementing.

    I would really support a production level version of HtmlTextBlock becoming a permanent part of the Silverlight Toolkit.

    David Roh


  3. kangta198588 says:

    Thank you for your control,it’s very good.I have a quesstion,can you turn the "htmltextblock" to a "htmltextbox"?

    Because I need  the text to be selected by the cursor.The "textblock" doesn’t support it.

  4. David Anson says:


    I’m afraid this transition would probably be quite a bit of work. That’s not to say it’s not possible to write a RichTextBox for Silverlight (search the web – others have done it!), but just to say that I don’t see an easy path from my HtmlTextBlock sample to an HtmlTextBox.

    Hope this helps!

  5. kangta198588 says:


    thank you for reply so quickly.I have already downloaded the RichTextBox,but it doesn’t support to translate html.Actually,it’s not necessary for me to change an HtmlTextBlock to an HtmlTextBox ,I just want to select the text by the cursor in an HtmlTextBlock.Can it  be achieved ?

  6. David Anson says:


    Not easily, I’m afraid…

  7. antonmaju says:

    Hi Delay,

    The source code link seems to be broken. Could you reupload the source code?


  8. David Anson says:


    Sorry for the trouble! My web site hoster seems to be having issues – I’ve contacted them now to report the problem and ask about a resolution. Please check back a few times over the next few days as I hope to have the issue resolved fairly quickly.

    If it’s urgent, please use the "Email" link at the upper-right of the page to contact me and I’ll send you the files in email for now. 🙂


  9. jongalloway says:

    What’s the license for this code? MsPl? And… any thoughts about putting it up at CodePlex or MSDN Code Gallery?

  10. David Anson says:


    Pretty much everything on my blog is Ms-PL (I’ve got a link to that effect in the sidebar, but I agree it’s not super-obvious). In particular, HtmlTextBlock *is* Ms-PL and you’re welcome to use it however you’d like! 🙂

  11. David Anson says:


    I forgot to address the second part of your comment. 🙁 Yes, I occasionally consider putting my stuff up on some public code site, but whenever I do, the overhead of that process just seems excessive for the benefit folks will get out of it. If you have particular opinions on the matter, I’d be happy to chat more – just contact me via the "Email" link in the sidebar.

    Thanks for your help!

Comments are closed.

Skip to main content