views:

230

answers:

1

Hi!

I would like to start a fontsize animation of a textblock from C# code. How can I do this?

I want increase/decrease fontsize during a period of 1 second.

Thanks!

A: 
DoubleAnimation animation = new DoubleAnimation(20, TimeSpan.FromSeconds(1.0));
MyTextBlock.BeginAnimation(TextBlock.FontSizeProperty, animation);

Where MyTextBlock is the instance of the TextBlock you wish to animate, and 20 is the target fontsize.

Mike Pateras