MouseLeftButtonDown is not getting fired

淺唱寂寞╮ 提交于 2020-02-04 06:36:06

问题


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

回答1:


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?



来源:https://stackoverflow.com/questions/3602250/mouseleftbuttondown-is-not-getting-fired

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!