Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从 C# 代码开始一个文本块的字体大小动画。我怎样才能做到这一点?
我想在 1 秒内增加/减少字体大小。
谢谢!
DoubleAnimation animation = new DoubleAnimation(20, TimeSpan.FromSeconds(1.0)); MyTextBlock.BeginAnimation(TextBlock.FontSizeProperty, animation);
其中 MyTextBlock 是您希望设置动画的 TextBlock 的实例,20 是目标字体大小。