0

I have this xaml in my page:

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                        <TextBlock Name="Content" IsTextSelectionEnabled="True" 
                            FontSize="20"
                            TextWrapping="Wrap"
                            HorizontalAlignment="Right"/>
                    </ScrollViewer>

There is no option to horizontally scroll with the mouse. However, if I use touch mode (I use the simulator) I can drag the text from left to right with my 'finger'.

If I comment out the ScrollViewer this behaviour stops. I can only assume that Disabled HorizontalScrollBarVisibility is not preventing the touch user from scrolling horizontally. This is a minor annoyance, but how can I prevent this horizontal scrolling?

Nathan Cooper
  • 6,262
  • 4
  • 36
  • 75

1 Answers1

3

You'll also want to disable HorizontalScrollMode. HorizontalScrollBarVisibility is a separate property from the one that handles the actual behavior, which I get is a bit strange because 95% of the times you either Disable both or set both to Auto, bit I guess it is just an API design choice that gives you a bit more power.

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100