using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Windows.Threading; namespace SilverlightApplication1 { public partial class leht2 : UserControl { int rx = 10; int a = 3; int nurk = 20; public leht2() { InitializeComponent(); DispatcherTimer kell = new DispatcherTimer(); kell.Interval = new TimeSpan(0, 0, 0, 0, 100); kell.Tick += new EventHandler(kell_Tick); kell.Start(); } void kell_Tick(object sender, EventArgs e) { rx -= 1; a++; ruut1.Width = a; ruut1.Height = a; Canvas.SetLeft(ruut1, rx); nurk+=5; tr1.Angle = nurk; } private void Button_Click(object sender, RoutedEventArgs e) { rx += 50; Canvas.SetLeft(ruut1, rx); //Lisage teine nupp ruudu vasakule liigutamiseks //ruut1.Width = 80; //Pange ruut automaatselt suurenema } } }