protected void UpdateTargetState(Control c)
{
// Check we have a valid control to convert coordinates against
if ((c != null) && !c.IsDisposed)
{
// Ensure control is inside a visible top level form
Form f = c.FindForm();
if ((f != null) && f.Visible)
{
UpdateTargetState(c.PointToClient(Control.MousePosition));
return;
}
}
UpdateTargetState(new Point(int.MaxValue, int.MaxValue));
}