HitTestResultBehavior.Continue 是表示继续处理更深层的交叠的视觉元素,如果改为 Stop ,则只处理最表层的视觉元素
Point p= e.GetPosition(sender as UIElement); VisualTreeHelper.HitTest(this, null, f => { tb1.Text+= f.VisualHit.ToString(); return HitTestResultBehavior.Continue; }, new PointHitTestParameters(p));