日期:2014-05-17 浏览次数:20758 次
private void dataGridView_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
dataGridView.Rows[e.RowIndex].Selected = true;//移入选中整行
}
private void dataGridView_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
dataGridView.Rows[e.RowIndex].Selected = false;//离开之后不选中
}
private void dataGridView_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1)
dataGridView.Rows[e.RowIndex].Selected = true;
}
private void dataGridView_CellMouseLeave(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1)
dataGridView.Rows[e.RowIndex].Selected = false;//离开之后不选中
}