4,816
社区成员
发帖
与我相关
我的任务
分享
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");
}
}