private void dgvShow_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
DataGridViewRow dgr = dgvShow.Rows[e.RowIndex];
if (dgr.Cells["是否已回站"].Value.ToString() == "是")
{
if (e.RowIndex % 2 == 0)
{
dgr.DefaultCellStyle.BackColor = Color.LightCyan;
}
else
{
dgr.DefaultCellStyle.BackColor = Color.White;
}
}
else
{
dgr.DefaultCellStyle.BackColor = Color.Yellow;
}
}
绘制方法写
DataGirdView嵌套mdi中样式影响后的解决方案
最新推荐文章于 2025-08-09 10:57:32 发布
