<Window.Resources>
<Storyboard Name="MyStoryboard" x:Key="MyStoryboard">
<DoubleAnimation From="0" To="300" Duration="00:00:4" Storyboard.TargetName="ellipse1" Storyboard.TargetProperty="(Canvas.Right)">
<DoubleAnimation.EasingFunction>
<BounceEase Bounciness="1" Bounces="1" EasingMode="EaseIn"></BounceEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</Window.Resources>
<Canvas Width="1500">
<Ellipse Height="50" HorizontalAlignment="Left" Margin="223,99,0,0" Name="ellipse1" Stroke="Black" VerticalAlignment="Top" Width="56" Fill="#FFF24444" />
<Button Height="300" Width="200" Click="button1_Click" />
</Canvas>
求高手把上述功能在后台实现.......邮箱747857485@qq.com
Ellipse ellipse1= new Ellipse();
ellipse1.Height = 50;
ellipse1.Margin = new Thickness(223,99,0,0,);
SolidColorBrush mySolidColorBrush = new SolidColorBrush();
mySolidColorBrush.Color = Color.FromArgb(255, 242, 68, 68);
ellipse1.Fill = mySolidColorBrush;
//...添加更多属性。
canvas.Children.Add(ellipse1);
Storyboard MyStoryboard = new Storyboard();
DoubleAnimation dm = new DoubleAnimation();
//设置属性。。
MyStoryboard.Children.Add(dm);
MyStoryboard .
、、等等更多。
我是纯手工在这电脑少敲的。你在vs下应该有相应的属性提示。
具体参考这个。http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard.aspx