Reputation: 235
I need to have this event for my cursor interacting with my textbox IN A GRIDVIEW. I tried using TextBox1_MouseEnter or any sort but IntelliSense can't help me. Am I missing a namespace? I have NO IDEA where to start to control mouse events.
Upvotes: 1
Views: 190
Reputation: 1737
There is no event on Gridview TextBox1_MouseEnter
instead try this code.
private void dataGridView1_CellEnter(object sender, DataGridViewCellEventArgs e)
{
dataGridView1[e.ColumnIndex, e.RowIndex].Style.SelectionBackColor = Color.Blue;
}
private void dataGridView1_CellLeave(object sender, DataGridViewCellEventArgs e)
{
dataGridView1[e.ColumnIndex, e.RowIndex].Style.SelectionBackColor = Color.Empty;
}
Upvotes: 2