0
在我的開發maschine這個代碼看起來不錯。c#datagridview圖形問題cell.style.backcolor
foreach (DataGridViewRow dgr in dgListe.Rows)
{
if (dgr.Cells["ColorName"].Value != "" && dgr.Cells["ColorName"].Value != null)
{
foreach (DataGridViewCell drgc in dgr.Cells) {
drgc.Style.BackColor = Color.FromName(dgr.Cells["ColorName"].Value.ToString());
}
}
}
工作不如
foreach (DataGridViewRow dgr in dgListe.Rows)
{
if (dgr.Cells["ColorName"].Value != "" && dgr.Cells["ColorName"].Value != null)
{
DataGridViewCellStyle zs = new DataGridViewCellStyle();
zs = dgr.DefaultCellStyle;
zs.BackColor = Color.FromName(dgr.Cells["ColorName"].Value.ToString());
dgr.DefaultCellStyle = zs;
}
}
但在某些pc's像做一個shaddow副本?在滾動列表時它是自己的。 (ATT截圖)
確定:(新PC's) - >
N.OK:(舊PC's) - >
信息:Dotnotfx 4客戶端框架,std。 WinForm的項目,任何CPU