locked
How to get current textpointer/offset of RichTextBlock in a scrollviewer RRS feed

  • Question

  • I have a richtextblock in a scrollviewer, the content of the richtextblock is very long. When I scroll the content, how can I get the first word or first TextPointer or first Offset which we can see in the scrollviewer.
    Monday, September 2, 2013 9:07 AM

Answers

  • Hi InfiXu,

    Oh, sorry, I made a mistake, I did not go detail into the snap point.

    We can get the HorizontalOffset and VerticalOffset, I think you could use this two parameters to calculate the offset of scollview child control.

    --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.


    Wednesday, September 4, 2013 4:59 AM
    Moderator

All replies

  • Hi InfiXu,

    Take a look at VerticalSnapPointsAlignment and HorizontalSnapPointsAlignment. I think you will need it.

    Best Regards,

    --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.

    Tuesday, September 3, 2013 2:43 AM
    Moderator
  • Sorry, it is not about snap points, I just want to get the first textpointer we can see in the scrollviewer
    Wednesday, September 4, 2013 2:55 AM
  • Hi InfiXu,

    Oh, sorry, I made a mistake, I did not go detail into the snap point.

    We can get the HorizontalOffset and VerticalOffset, I think you could use this two parameters to calculate the offset of scollview child control.

    --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.


    Wednesday, September 4, 2013 4:59 AM
    Moderator