I want to add a scrolling/moving text(from right to left) in the textblock. It should scroll one time only. I have Googled it but didn't find anything. I want to scroll the text in the textblock (not the whole textblock) only once. Then scrolling should be stopped.
I found this code on net but it is not what I want. I want to scroll the text 1 time and then stop scrolling. Any idea how to do that?
<TextBlock FontSize="22" x:Name="txtScrolling" Margin="1386,208,-616,460">
<TextBlock.RenderTransform>
<TranslateTransform x:Name="translate" />
</TextBlock.RenderTransform>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard>
<Storyboard RepeatBehavior="1">
<DoubleAnimation
From="1000" To="-1000"
Storyboard.TargetName="translate"
Storyboard.TargetProperty="X"
Duration="0:0:10" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
This is the Text to Scroll
</TextBlock>
You could try something like this..
This is an xaml example:
Code behind: