开发者

Is there any way to find out mouse left button up event outside of an element in wpf?

开发者 https://www.devze.com 2023-02-03 23:43 出处:网络
I will define an event for m开发者_开发问答y border element that relize mouse left button up outside of this element.You can get mouse up event outside the element who received mouse down, if on the m

I will define an event for m开发者_开发问答y border element that relize mouse left button up outside of this element.


You can get mouse up event outside the element who received mouse down, if on the mouse down you call element.CaptureMouse() (and on mouse up, do not forget to call element.ReleaseMouseCapture()).


        Mouse.Capture (this,CaptureMode.SubTree);
        AddHandler ();

    private void AddHandler()
    {
        AddHandler (Mouse.PreviewMouseDownOutsideCapturedElementEvent,new MouseButtonEventHandler (HandleClickOutsideOfControl),true);
    }
0

精彩评论

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