Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


CSharp Programming

CSharp > Code Examples

Bouncing Ball

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
Bouncing Ball <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"> <Ellipse Name="elips" Width="40" Height="40" Fill="Red" Canvas.Left="80"> <Ellipse.Triggers> <EventTrigger RoutedEvent="Ellipse.Loaded"> <BeginStoryboard> <Storyboard TargetName="elips" TargetProperty="(Canvas.Top)" RepeatBehavior="Forever"> <DoubleAnimationUsingKeyFrames> <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="96" /> <SplineDoubleKeyFrame KeyTime="0:0:1" Value="480" KeySpline="0.25 0, 0.6 0.2" /> <SplineDoubleKeyFrame KeyTime="0:0:2" Value="96" KeySpline="0.75 1, 0.4 0.8" /> </DoubleAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </Ellipse.Triggers> </Ellipse> </Canvas>