问题描述
大家好,
虽然我尝试将鼠标悬停在标签"元素, Mouse.DirectlyOver,它返回"TextBlock".因此.为什么会这样?
private void Dynamic_Design_PreviewMouseMove(对象发送方,MouseEventArgs e)
{
if(e.LeftButton == MouseButtonState.Pressed)
{
var uiElement = Mouse.DirectlyOver as UIElement;
}
}
对此有任何想法吗??
谢谢,
Sowndaiyan
Hi All,
While i try to mouse over on the "Label" element , Mouse.DirectlyOver it returns the "TextBlock" as a result. Why it happen like this?
private void Dynamic_Design_PreviewMouseMove(object sender, MouseEventArgs e)
{
if(e.LeftButton == MouseButtonState.Pressed)
{
var uiElement = Mouse.DirectlyOver as UIElement;
}
}
Any idea on this..?
Thanks,
Sowndaiyan
推荐答案
这篇关于Mouse.DirectlyOver在WPF中返回错误的UIElement的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!