MouseLeftButtonDown 没有被解雇 [英] MouseLeftButtonDown is not getting fired
问题描述
我有一个从 UserControl 类派生的 WPF 用户控件.MouseLeftButtonDown 根本没有因为控制而被触发.我添加了事件处理程序,并尝试如下.我想它是在其他地方处理的,如何调试并找到它在哪里得到处理.. 任何帮助表示赞赏!
I have a WPF user control that is dervied from UserControl class. MouseLeftButtonDown is not getting fired at all for the contol. I added event handler and also tried as follows. I guess it is handled somewhere else, how to debug and find where is it getting hanlded.. Any help is appreciated!
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
}
推荐答案
您是否将 UserControl 的背景设置为某些内容?如果没有,请尝试将其设置为背景=透明",看看是否有效.如果它不起作用,您能否发布 UserControl 的 XAML 及其用法?
Did you have the Background of the UserControl set to something? If not, try setting it to "Background=Transparent" and see if that works. If it doesn't work, can you post the XAML for your UserControl, as well as the XAML for its usage?
这篇关于MouseLeftButtonDown 没有被解雇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!