locked
How to make a ScrollViewer zoom only at horizon RRS feed

  • Question

  • Hi all,

    I want to make my controls that in a  ScrollViewer only change width when the ScrollViewer zoom.

    How can I do?

    Tuesday, December 17, 2013 5:11 AM

Answers

  • Hi Shirley-cheng,

    The ScrollViewer doesn't support separate horizontal and vertical zoom. You would need to write your own control for this. You can handle zooming input via manipulation events, mouse, and keyboard and then apply a ScaleTransform which sets ScaleX to do the horizontal zoom but leaves the ScaleY factor at 1.0.

    --Rob

    • Marked as answer by Shirley-cheng Wednesday, December 18, 2013 5:06 AM
    Wednesday, December 18, 2013 2:33 AM
    Moderator

All replies

  • Tuesday, December 17, 2013 5:51 AM
  • Hi, Sarath Satheesh,

    I have red the article that you said, but I want a Scrollviewer that can achieve horizonscroll and verticalscroll,

    but only can zoom in horizonal, it is means that when I zoom, only the width can be changed.

    Wednesday, December 18, 2013 1:55 AM
  • Hi Shirley-cheng,

    The ScrollViewer doesn't support separate horizontal and vertical zoom. You would need to write your own control for this. You can handle zooming input via manipulation events, mouse, and keyboard and then apply a ScaleTransform which sets ScaleX to do the horizontal zoom but leaves the ScaleY factor at 1.0.

    --Rob

    • Marked as answer by Shirley-cheng Wednesday, December 18, 2013 5:06 AM
    Wednesday, December 18, 2013 2:33 AM
    Moderator
  • Thanks a lot!
    Wednesday, December 18, 2013 5:06 AM