Share via

Pointer released event doesn't raised as expected

Shay Wilner 1,746 Reputation points
2020-06-29T18:28:38.157+00:00

Hi
in windows form app i have the mouse up event but not in uwp so i try to use the similar event pointer released.
I drag an image and when the mouse button is up i expected the image pointer released event to be raised but this is not
only if i released the mouse and click again the image and release then the event occurs
How to cause the pointer released event raised like the "mouse up event"

Thanks

Developer technologies | Universal Windows Platform (UWP)

Answer accepted by question author

Shay Wilner 1,746 Reputation points
2020-06-30T21:32:55.48+00:00

i succeeded
My drag and drop were incorrect
i don't need to use the pointerreleased event of the image

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. John Torjo 861 Reputation points
    2020-06-29T18:33:38.887+00:00

    In order to make sure the mouse up event occurs, you need to capture the pointer, like this:

    your_control.CapturePointer(args.Pointer)
    

    On PointerReleased, don't forget to release it:

    your_control.ReleasePointerCapture(args.Pointer)
    

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.