With a DataGridView control on a Windows form, when you move the mouse over a row label (or column label) it\'s (the label cell) background changes to a shade of blue (or ot
You can hook into the DataGridView's CellMouseEnter and CellMouseLeave events and then change the backcolor accordingly. Something like this:
private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0) //column header / row headers
{
return;
}
this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.LightBlue;
}
private void dataGridView1_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0) //column header / row headers
{
return;
}
this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor = Color.White;
}