开发者

UIElement.IsMouseOver returns false

开发者 https://www.devze.com 2023-01-27 23:59 出处:网络
UIElement.IsMouseOver will return false if an other element will over (ZOrder >) that UIElemnt. 开发者_运维百科Is there a property IsMouseOver = true for that case?If you want to determine mouse over

UIElement.IsMouseOver will return false if an other element will over (ZOrder >) that UIElemnt.

开发者_运维百科

Is there a property IsMouseOver = true for that case?


If you want to determine mouse over states for layered elements you can do manual hit testing.

See Can I make WPF set IsMouseOver for both the covering and covered element?


UIElement.IsMouseOver is true if mouse pointer is over the element or its child elements; otherwise, false. The default is false.

UIElement.IsMouseDirectlyOver true if the mouse pointer is over the same element result as a hit test; otherwise, false. The default is false.

If something was in front of the control (and not a child element) then this would "block" the IsMouseOver property. There is no property in UIElement which ignores the "hit test".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号