我有一个按钮名为Button1。我想在动画中更改此按钮的字体大小。因此,我在Window_Loaded函数中编写了代码。
DoubleAnimation da = new DoubleAnimation(0, 25, new Duration(TimeSpan.FromSeconds(3)));
//da.TargetPropertyType = "Width";
da.RepeatBehavior = RepeatBehavior.Forever;
button1.BeginAnimation(Button.FontSizeProperty, da);
但是我遇到了一个错误-
无法使用'System.Windows.Media.Animation.DoubleAnimation'在'System.Windows.Controls.Button'上动画化'FontSize'属性。详情请参见内部异常。
1)如何动画化按钮字体大小? 2)我需要动画化哪些按钮属性?