Solved

Windows Phone 7 - Text Block not displaying all the text it is assigned.

Posted on 2011-02-14
4
1,627 Views
Last Modified: 2014-11-12
I have a text block inside a scroll viewer.  I am reading a text file into a string and assigning it to the text block.  When I step through the code the complete text document has been properly assigned to the string and the text block displays the 1st "x" characters as it should.  The remaining text isn't visible but you can still scroll the empty text down (as if it was there) until you hit the bottom.  It's like the text block knows the character count but just isn't displaying it all... though it appears to be "using" the appropriate space it would take to display it... seems to be a weird quirk that I'm hoping will be logical to someone :)

To create the string I am doing the following...

var resource = Application.GetResourceStream(new Uri(@"/Tracker;component/HelpFileText.txt", UriKind.Relative));
StreamReader streamReader = new StreamReader(resource.Stream);
StringBuilder sb2 = new StringBuilder();
sb2.Append(streamReader.ReadToEnd());
txblTest.Text = sb2.ToString();

The xaml is very basic... inside te content panel I have a scroll viewer and the text block is inside that.  Scroll view's height is 440 x 591 and the text blocks is Auto(0) for both.

It appears to be displaying about 40% of the text in the document before it "goes black"... is there possibly some restriction to character length max in a textblock?  One thing you can't see on the screen shot is that the vertical "scroll bar indicator" is about 1/2 the way down the screen... you can continue to scroll down through the blank area until you hit the bottom.

Thanks,
Greg

 Screen shot
0
Comment
Question by:Greg_L_WER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:hb11
ID: 34911735
0
 

Author Comment

by:Greg_L_WER
ID: 34911888
Thanks hb11... unfortunately that link is to my initial question on this issue :(  It did solve part of my issue but uncovered another one...
0
 
LVL 4

Accepted Solution

by:
hb11 earned 250 total points
ID: 34919985
I'm sorry I didn't see that yesterday.

Though you need to have some experience and time  to find out what exactly to do:
http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx
may give you the answer you're looking for.

Hope this helps you a little bit more :)
0
 

Author Comment

by:Greg_L_WER
ID: 34954381
Thanks for your help hb11... looks like that will do the trick :)  I knew there had to be some logical reason... finding it is always the trick.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question