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 NuppudeLoomine : UserControl { public NuppudeLoomine() { InitializeComponent(); int x = 0, y = 100; for (int i = 1; i <= 9; i++) { Button b = new Button(); b.Content = i.ToString(); Canvas.SetLeft(b, x); Canvas.SetTop(b, y); juur.Children.Add(b); b.Click += new RoutedEventHandler(numbrinupp_Click); x += 20; if (i % 3 == 0) { x = 0; y += 30; } } } private void numbrinupp_Click(object sender, RoutedEventArgs e) { plokk1.Text += (sender as Button).Content; } } }