[WPF]64*64的表涂色问题

64*64的表涂色

for (int i = 0; i < 64; i++)
            {
                for (int j = 0; j < 64; j++)
                {
                    if ((i + j) % 2 == 0)
                    {
                        Grid grid = new Grid();
                        grid.Background = Brushes.Pink;
                        grid1.Children.Add(grid);
                        Grid.SetColumn(grid, j);
                        Grid.SetRow(grid, i);
                    }
                    else
                    {
                        Grid grid = new Grid();
                        grid1.Children.Add(grid);
                        Grid.SetColumn(grid, j);
                        Grid.SetRow(grid, i);
                    }
                }
            }
posted @ 2020-05-25 14:15  养鼠的猫  阅读(138)  评论(0编辑  收藏  举报