locked
Problem with the ScrollViewer

    Question

  • I am trying to place an Image into the ScrollViewer - in order to be able to pan across the image in my app. I would like to be able to pan both horizontally and vertically.

    My problem is that I am able to pan only vertically. In horizontal direction the image is clipped to the ScrollViewer bound and no scrollbar is visible.

    I tried to play with the "XAML scrolling, panning, and zooming sample" from Microsoft sample pack. Its C++ version (ScrollViewerCPP.sln) exposes the same behaviour: no horizontal scrolling.

    Its C# version (ScrollViewerSample.sln) works correctly: both scrollbars are visible and I can move the image in both directions.

    The XAML files in these two samples (Scenario1.xaml in both samples) seem to be the same in this respect. I failed to find the difference.

    Could you please explain how I should use the ScrollViewer correctly in C++ program?

    Saturday, November 24, 2012 9:56 PM

Answers

  • I was able to use the C++ sample to do horizontal scrolling with a horizontal scroll bar.  I had to change the "Horizontal Scrollbar Visibility" combo box to "Visible" as shown below.   Are you able to do this? 

    • Marked as answer by Яков Sunday, November 25, 2012 9:12 AM
    Sunday, November 25, 2012 4:35 AM

All replies

  • I was able to use the C++ sample to do horizontal scrolling with a horizontal scroll bar.  I had to change the "Horizontal Scrollbar Visibility" combo box to "Visible" as shown below.   Are you able to do this? 

    • Marked as answer by Яков Sunday, November 25, 2012 9:12 AM
    Sunday, November 25, 2012 4:35 AM
  • Thank you for reply.

    I am able to do this.

    Probably I was confused by the fact that the page is too large and must be scrolled down to have that scrollbar visible.

    Sunday, November 25, 2012 9:12 AM