private static Control GetVisibleChildAtDesktopPoint( Control topControl, Point desktopPoint )
{
Control foundControl = topControl.GetChildAtPoint( topControl.PointToClient( desktopPoint ) );
if (foundControl != null)
{
if (foundControl.HasChildren)
{
foreach (Control control in foundControl.Controls)
{
foundControl = GetVisibleChildAtDesktopPoint(control, desktopPoint);
if (foundControl != null && foundControl.Visible)
break;
}
}
}
return foundControl ?? topControl;
}