How to display an string in an RichTextBlock - Windows Store Apps

2.4k Views Asked by At

I'm creating an Windows 8.1 Store Application, and I need to distribute a string over a RichTextBlock and an RichtTextBlockOverflow but I can't find a solution on the internet.

Any help would be very nice!

1

There are 1 best solutions below

0
On

In XAML

    <RichTextBlock>
      <RichTextBlock.Blocks>
        <Paragraph>
          <Paragraph.Inlines>
            <Run Text="Some Text" />
          </Paragraph.Inlines>
        </Paragraph>
      </RichTextBlock.Blocks>
    </RichTextBlock>

In Code

    Dim p As New Paragraph
    p.Inlines.Add(New Run With {.Text = "Some text"})
    Dim myRichTxtBox As New RichTextBlock
    myRichTxtBox.Blocks.Add(p)