I have a Panel that contains child controls.
If I handle the Panel\'s MouseEnter and MouseLeave events, and its c
The solution is to track the number of enters/leaves. In you overall control add a counter:
private int mouseEnterCount = 0;
In the MouseEnter handler do this:
if (++mouseEnterCount == 1)
{
// do whatever needs to be done when it first enters the control.
}
In the MouseLeave handler do this:
if (--mouseEnterCount == 0)
{
// do whatever needs to be done when it finally leaves the control.
}
and do the above MouseEnter and MouseLeave event handlers for ALL the child controls as well as the containing object.