Solved

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

Posted on 2011-02-14
4
1,624 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
  • 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Updates question 2 30
Event log and black screen 22 42
Unknown Windows 7 64-bit Screen Appearance 5 38
Missing number of chat in Whatapps icon 5 24
Once again I push the limits of my phone.  An introduction to the Android Google Now Launcher.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

772 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