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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:58:31+00:00 2026-05-27T01:58:31+00:00

I’m using the richtextbox to show some Html content in windows phone 7.1. The

  • 0

I’m using the richtextbox to show some Html content in windows phone 7.1.

The html source-code is like:

Paragraph1</p>
<img src="http://www.ifanr.com/wp-content/uploads/2011/11/DSC_332401.jpg" alt="" width="600" height="338" /></p>
Paragraph2。</p>
<h3>Title h3</h3>
Paragraph3。
</p>

Then I use the

"string[] sArray = Regex.Split(html, "</p>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);"

to split them into a Array. Finally, I use the code:

foreach (string array in sArray)
            {
                Paragraph parag = new Paragraph();
                Run run = new Run();
                Bold bold = new Bold();
                if (!Regex.IsMatch(array.ToString(), @"<img\b[^<>]*?\bsrc\s*=\s*[""']?\s*(?<imgUrl>[^\s""'<>]*)[^<>]*?/?\s*>"))
                {
                    //h3
                    if (array.ToString().Contains("</h3>"))
                    {
                        string hString = array.ToString();
                        hString = Regex.Replace(hString, "<h3>", "");
                        string[] hArray = Regex.Split(hString, "</h3>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
                        bold.Inlines.Add(hArray[0].ToString());
                        parag.Inlines.Add(bold);
                        run.Text = hArray[1].ToString();
                        parag.Inlines.Add(run);
                    }
                    else
                    {
                        if(array.ToString().Contains("<blockquote>"))
                        {
                            run.Text = Regex.Replace(array.ToString(), "<blockquote>", "blockquote:");
                            run.FontSize = 18;
                        }
                        else
                            run.Text = array.ToString();
                        parag.Inlines.Add(run);
                    }
                    rtb.Blocks.Add(parag);
                }
                else
                {
                    //insert the image into richtextbox
                    Regex regImg = new Regex(@"http://[^\[^>]*?(gif|jpg|png|jpeg|bmp|bmp)", RegexOptions.IgnoreCase);
                    MatchCollection matches = regImg.Matches(array.ToString());
                    string result = null;
                    foreach (Match match in matches)
                        result = match.Value;

                    Image image = new Image();

                    image.Stretch = Stretch.Uniform;
                    image.Source = new BitmapImage(new Uri(result, UriKind.RelativeOrAbsolute));
                    InlineUIContainer iuc = new InlineUIContainer();
                    iuc.Child = image;
                    parag.Inlines.Add(iuc);
                    rtb.Blocks.Add(parag);
                }

to add some Paragraph or images into the richtextbox, everything goes well in the beginning, but when I Scroll down the richtextbox, the rest paragraph disappear. It confused me all day long, as I could’t find out what’s wrong with the richtextbox.
Is it just a bug in Windows phone? Any thoughts?

ScreenShot1:

screenshot 1

ScreenShot2:

Screenshot 2

p.s:it doesn’t matter whether the html source-code contains some non-english characters or not. This happens when the html source-code is in a large amount of words. These two ScreenShots just show the problem.

  • 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-27T01:58:32+00:00Added an answer on May 27, 2026 at 1:58 am

    The phone applies a restriction that any UIElement can’t be larger than 2048 pixels in any direction. This is enforced to avoid performance issues relating to memory and having to draw very large objects. This is to protect you from doing something that greatly affects performance but also has some other reasoning behind it. For example, a phone is a poor device for reading large pieces of text. This applies even more so for dense bodies of text. This size restriction therefore forces you to think about how, or if you should, display large pieces of text within your application.

    There are some solutions though.
    Rather than using a single Paragrpah or TextBlock for a large “unit” of text, you could consider using something like this: http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string

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.