Thursday, May 9, 2013

Storyboard to make textblock bigger

Try this



<TextBlock Name="txtBlock">Test</TextBlock>




DoubleAnimation expand = new DoubleAnimation();
expand.From = 20;
expand.To = 300;
Storyboard.SetTargetProperty(expand, "(TextBlock.FontSize)");
Storyboard.SetTarget(expand, txtBlock);
expand.EnableDependentAnimation = true; // This is needed for this kind of animation to work.
Storyboard sbText = new Storyboard();
sbText.Children.Add(expand);
sbText.Begin();





Thanks,

Sachin

My Samples | Personal Website

No comments:

Post a Comment