Levvy
Levvy

Reputation: 1150

How to animate(X scrolling) text in TextBox in UWP/WinRT app?

I am making application in UWP and have read-only TextBox with strict-size. I want to make users to only see and copy text from that box. Unfortunately sometimes text inside is too long and to show it I will need to make scrolling animation in X axis. I do not know how to make it.


I tried: https://msdn.microsoft.com/en-us/library/cc645061%28v=vs.95%29.aspx?f=255&MSPPError=-2147217396 but I end up with errors with ToolTips control so removed it but still do not know what to edit to enable animation when text is too long for TextBox.


Anybody know solution?

Upvotes: 0

Views: 823

Answers (2)

user2302028
user2302028

Reputation: 1

this works for me

 <TextBox x:Name="textBox1" Margin="10" TextWrapping="Wrap" Text="" FontFamily="Consolas" Background="White" AcceptsReturn="True" IsReadOnly="True" InputScope="Text" ManipulationMode="System" RequestedTheme="Dark" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"/>

Upvotes: 0

Nasser AlNasser
Nasser AlNasser

Reputation: 1775

You can set the height to Auto, and TextWrapping to Wrap, then the textbox will take the available space as needed..

Better solution is to use a selectable TextBlock w/ ScrollViewer as:

<ScrollViewer>
     <TextBlock IsTextSelectionEnabled="True" TextWrapping="Wrap" />
</ScrollViewer>

Upvotes: 1

Related Questions