for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { if (i % 2 == 0) { dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Red; } else { dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.Green; } }
109,896
社区成员
642,645
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧