Search code examples
windows-phone-7richtextboxtextblock

WP7 How to display data in TextBlock?


I created a TextBlock link this:

<TextBlock x:Name="content" TextWrapping="Wrap" Width="40"/>

String largeText = "";

content.Text=largeText;

largeText has 3000 pixels, but only 2048 are being displayed. It shows empty text after that.

How can I show largeText in TextBlock?


Solution

  • Try using this scrollabletextbox control - http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx

    However, its important to note that such large chunks of text are going to have serious impacts on your applications performance, and you should consider some kind of pagination for your text content, as mentioned in this question - wp7 - TextBlock with a lot of text - huge memory usage - how to avoid it?