4

Developing a Windows 10 UWP (Universal Windows Platform) app here... I have a long text and I don't want to wrap it in several lines. I want it to be long so that the end user can horizontally scroll to see the entire text in one line.

    <ScrollViewer HorizontalScrollMode="Enabled" Width="Auto">

<TextBlock Text="This is a long text that I don't want it to be wrapped in multiple lines. I want it to be horizontally long so the user can horizontally scroll to see the text"

Margin="50, 50, 0, 0"></TextBlock>

</ScrollViewer>

But when I run the app the text is cut off on the right edge and I cannot scroll it horizontally to see the rest of the text. Is there a way to achieve that using a ScrollView with some additional attributes? Here is the screen shot how the app looks.

enter image description here

L_A_Hooper
  • 81
  • 1
  • 9

1 Answers1

13

You need to also set HorizontalScrollBarVisibility="Auto" on the ScrollViewer.

ScrollViewer.HorizontalScrollMode property

Gets or sets a value that determines how manipulation input influences scrolling behavior on the horizontal axis.

ScrollViewer.HorizontalScrollBarVisibility property

Gets or sets a value that indicates whether a horizontal ScrollBar should be displayed.

Justin XL
  • 38,763
  • 7
  • 88
  • 133