public virtual Component ComponentFromPoint(Point pt)
{
// Find the view element associated with the point
ViewBase target = Root.ViewFromPoint(pt);
// Climb parent chain looking for the first element that has a component
while (target != null)
{
if (target.Component != null)
return target.Component;
target = target.Parent;
}
return null;
}