开发者

OnMouseMove() event handler delegation

I'm trying to write to a status bar the current mouse position and in order to that I took over OnMouseMove() event handler which is triggered when the mouse cursor enters my control. The problem is that in my开发者_如何学编程 control I have a WPF control which is has Dock.Fill Dockstyle, meaning, it fills the entire parent control.

When I run the applicaiton I see that nothing happens and the mouse position isn't updated, so I've noticed that the OnMouseMove() event of the WPF control is triggered and not the OnMouseMove() event of my control, which contains the relevant code for updating the mouse location coordinates.

I wanted to know if there's a way (other than implementing the code in the WPF OnMouseMove() event handler, of course) to bypass the WPF control event handler and use always my control's event handler.

I hope I was clear enough in my question, if not please let me know and I'll try to elaborate.

Thanks!


try the PreviewMouseMove-Version of OnMouseMove - this one should fire correct and you need to have some kind of background (not null) or your controll won't see the mouse - so give it a transparent color or something)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜