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; namespace SilverlightNaited { public partial class RuutudeArv2 : UserControl { public RuutudeArv2() { InitializeComponent(); } private void txtKogus_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { ala1.Children.Clear(); int kogus = Convert.ToInt32(txtKogus.Text); for (int i = 0; i < kogus; i++) { Animatsioon1 a = new Animatsioon1(); Canvas.SetLeft(a, i * 40); Canvas.SetTop(a, 30); ala1.Children.Add(a); } ala1.UpdateLayout(); } } } }