日期:2014-05-17 浏览次数:21195 次
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
dataGridView1.Rows[i].Selected = true;
//本行颜色变为红色
dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
dataGridView1.FirstDisplayedScrollingRowIndex = i;
System.Threading.Thread.Sleep(1000);
//让本行再次恢复颜色
dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Black;
}