日期:2014-05-20 浏览次数:20979 次
 private void button1_Click(object sender, RoutedEventArgs e)
        {
            for (int i = 0; i < 10; i++)
            {
                if (i % 2 == 0)
                {
                    Ellipse el = new Ellipse();
                    el.Height = 30;
                    el.Width = 60;
                    el.Fill = Brushes.Red;
                    el.Stroke = Brushes.Black;
                    canvas1.Children.Add(el);
                } 
                else
                {
                    //System.Threading.Thread.Sleep(1000);
                    Ellipse el = new Ellipse();
                    el.Height = 30;
                    el.Width = 60;
                    el.Fill = Brushes.Yellow;
                    el.Stroke = Brushes.Green;
                    canvas1.Children.Add(el);
                } 
                System.Threading.Thread.Sleep(1000);
                // MessageBox.Show("aa");
            }
        }