Is there a way to make controls transparent to mouse events in WPF?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 09:04:55

问题


Is there a way that I can let mouse events pass through to controls behind?


回答1:


Sure, just set IsHitTestVisible="False" on the control. Mouse events will pass through it.




回答2:


I usually solve these kind of issues by adding handlers of child controls to the parent at construction. This way the 'click'-event for example activates a method that raises the 'click'-event of the parent.



来源:https://stackoverflow.com/questions/4226770/is-there-a-way-to-make-controls-transparent-to-mouse-events-in-wpf

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