Answered by:
Blinking of the text

Question
-
How to make a text blink in a textblock and goes off?
Thanks in advance.
Regards
Manideep
Friday, August 22, 2014 7:52 AM
Answers
-
You could animate the Opacity property of the TextBlock to make it blink:
<TextBlock x:Name="textBlock" Text="Blinking!"> <TextBlock.Triggers> <EventTrigger RoutedEvent="TextBlock.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="textBlock" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> </EventTrigger> </TextBlock.Triggers> </TextBlock>
- Marked as answer by Jamles HezModerator Friday, September 5, 2014 9:38 AM
Saturday, August 23, 2014 10:23 AM -
There's no property that does that. You could set the text to null and then back to the text repeatedly.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.- Marked as answer by Jamles HezModerator Friday, September 5, 2014 9:38 AM
Friday, August 22, 2014 7:06 PMModerator
All replies
-
There's no property that does that. You could set the text to null and then back to the text repeatedly.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.- Marked as answer by Jamles HezModerator Friday, September 5, 2014 9:38 AM
Friday, August 22, 2014 7:06 PMModerator -
You could animate the Opacity property of the TextBlock to make it blink:
<TextBlock x:Name="textBlock" Text="Blinking!"> <TextBlock.Triggers> <EventTrigger RoutedEvent="TextBlock.Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="textBlock" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> </BeginStoryboard> </EventTrigger> </TextBlock.Triggers> </TextBlock>
- Marked as answer by Jamles HezModerator Friday, September 5, 2014 9:38 AM
Saturday, August 23, 2014 10:23 AM