Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fire the MouseUp event even when outside control in WPF

I want to be able in my WPF application to detect the MouseUp event from anywhere. That is to say, if the user clicks in the control and holds his click, then releases it outside the Control, I want my MouseUp event to fire.

I have done the MouseDown event, it works, but the MouseUp event isn't fired if released outside the Window.

like image 641
Adrien Neveu Avatar asked Oct 14 '25 04:10

Adrien Neveu


1 Answers

Add the CaptureMouse method in your MouseButtonDown handler

You can look up here on what it actually does.

like image 131
Mario Stoilov Avatar answered Oct 18 '25 01:10

Mario Stoilov