2

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!

Niels Verhoeven
  • 163
  • 1
  • 14
  • http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.richtextblock – Anuraj Jun 03 '14 at 08:18
  • Just found out what to do. In order to display the text I had to add an paragraph to the RichTextBlock, and in that paragraph I had to add an 'Run' statement with in it's Text property an binding to my string. Problem solved :) – Niels Verhoeven Jun 03 '14 at 08:42

1 Answers1

1

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)