开发者

C# WPF Controls within Controls and distinguishing LeftClick events!

I have UserControls within UserControls in WPF. This makes a tree structure starting from the root node.

I want to register for the event MouseLeftClickDown in all the UserControls. Left Clicking on a child control causes the event to fire for that control and all the parent controls that contain that child.

开发者_JAVA百科

When I click a child, I don't want to fire the event for any parent controls, I just want it to fire for the child control clicked.


You could use the MouseDownEvent. The MouseEventArgs passed to the handler should have a Handled property that if it is set to true indicates that the event should not be passed on to the controls higher up in the hierarchy.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜