WPF命中测试

时间:2020-07-01 21:19:43   收藏:0   阅读:69

 

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));

 

原文:https://www.cnblogs.com/dangnianxiaoqingxin/p/13221073.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!