You could probably handle a couple of event like grid.Leave and
grid.CellMouseEnter and use a Timer to catch a hoover action row by
row.
this.dataGridView1.CellMouseEnter += new
DataGridViewCellEventHandler(dataGridView1_CellMouseEnter);
this.dataGridView1.Leave += new
EventHandler(dataGridView1_Leave);
The code:
private Timer hooverTimer = null;
private int hooverRow = -1;
private int potentialHooverRow = -1;
private void TurnHooverOff()
{
if (hooverTimer != null)
hooverTimer.Enabled = false;
}
private void WaitForHoover(int row)
{
if (hooverTimer == null)
{
hooverTimer = new Timer();
hooverTimer.Interval = 500;// .5 sec hoover threshold time
hooverTimer.Tick += new EventHandler(hooverTimer_Tick);
}
TurnHooverOff();
potentialHooverRow = row;
hooverTimer.Enabled = true;
}
void hooverTimer_Tick(object sender, EventArgs e)
{
TurnHooverOff();
Console.WriteLine("A hoover has occurred at {0}",
potentialHooverRow);
hooverRow = potentialHooverRow;
}
void dataGridView1_Leave(object sender, EventArgs e)
{
TurnHooverOff();
}
void dataGridView1_CellMouseEnter(object sender,
DataGridViewCellEventArgs e)
{
if (e.RowIndex != hooverRow)
{
TurnHooverOff();
WaitForHoover(e.RowIndex);
}
}
=============
Clay Burch
Syncfusion, Inc.