locked
Automatic textblock horizontal scroll RRS feed

  • Question

  • Hello,

    I have a text that I generate from a list that is very long, around 20000 Words.

    What I want is for this text to look pretty much like a multiple column in the Picture below.

    I want is for this text to exist in a 200 pix columns and spread over to the right.

    Pretty much as you see the news app on the windows 8 having 3 or 4 columns that you can scroll over a wider part of the screen.

    I assume this cannot be handleled with the datacontext since it Always scrolls vertically down and doesn't break at the end of the height.

    Saturday, November 30, 2013 1:45 AM

Answers

  • Hi mymorningcoffee,

    If my understanding is correct, you may need cooperate with RichTextBlock and RichTextBlockOverflow, RichTextBlockOverflow will display the text content that does not fit in the bounds of a RichTextBlock or another RichTextBlockOverflow element.

    You could put a 200px width RichTextBlockOverflow on the right side of 200px width RichTextBlock to makes it looks like multi-column. 

    The code can be as follow:

    <RichTextBlock Width="200" FontSize="18" OverflowContentTarget="{Binding ElementName=overflow1}">
        <Paragraph>
           <Run>PUT YOUR 20000 WORDS HERE</Run>
        </Paragraph>
    </RichTextBlock>
    <RichTextBlockOverflow Width="200" x:Name="overflow1" OverflowContentTarget="{Binding ElementName=overflow2}"></RichTextBlockOverflow>
    <RichTextBlockOverflow Width="200" x:Name="overflow2"></RichTextBlockOverflow>

    --James



    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Saturday, November 30, 2013 3:04 PM
    Moderator