この質問への回答を高低で検索しました。この投稿の回答: DataGridView セルのボタンの色を変更すると、フォントに関する質問に回答されません。
私は次のことを試しました:
DataGridViewRow r = dataGridView.Rows[0];
r.Cells[1].Style.BackColor = Color.Red;
私も試しました:
DataGridViewButtonColumn btnCOl = new DataGridViewButtonColumn();
btnCOl.FlatStyle = FlatStyle.Popup;
DataGridViewRow r = dataGridView.Rows[0];
r.Cells[1].Style = new DataGridViewCellStyle { BackColor = Color.LightBlue };
それでも役に立たない。
次の行もコメントアウトしました。
// Application.EnableVisualStyles();
DataGridViewButtonColumn の単一のボタンの背景色を変更する方法を知っている人がいる場合は、助けてください。
編集: 列のセルに異なる色を設定したい.たとえば、一部は赤になり、他は緑になる. 列全体の色を設定したくありません。