private void dataGridView1_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White;
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Black ;
}
}
{
if (e.RowIndex != -1)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.White;
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Black ;
}
}
private void dataGridView1_CellMouseMove(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.RowIndex != -1)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightGray;
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Blue ;
}
}
{
if (e.RowIndex != -1)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightGray;
dataGridView1.Rows[e.RowIndex].DefaultCellStyle.ForeColor = Color.Blue ;
}
}
No comments:
Post a Comment