:::: MENU ::::

Marquee effect in TextBlock in Windows Phone

There is no any built in property for putting marquee effect in text block or for any controls in WP. But we can achieve that effect by doing animation using StoryBoard. So here I used Canvas and I put TextBlock inside Canvas and cliped it with certain dimension and in StoryBoard I am using DoubleAnimation and defining properties like To, From, TargetProperty, TargeName. For now I will show you marquee effect from right to left you can achieve left to right flow by just changing the value of “From” property of DoubleAnimation to positive.

Here is code in Xaml:

Now let’s begin the StoryBoard from code behind. In cs file:

Now run your app you will see cool marquee effect in TextBlock. You can use this technique for windows store app and WPF application too.

Thats it. Here is sample code.

Happy Coding 🙂