Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF RepeatButton MouseUp

Is there a way to get the MouseUpevent on the repeatbutton to fire when the button is not pressed anymore? I am trying to use the MouseMove event to track the position of the mouse while the button is pressed, but neither MouseDown nor MouseUp fire an event for the left mouse button. Any ideas or advice as to what can be done? Thank you

like image 999
ak3nat0n Avatar asked Apr 02 '26 17:04

ak3nat0n


1 Answers

It appears that the repeat button is marking the event as handled internally. You can use the PreviewMouseLeftButtonUp tunneling event to catch the event before RepeatButton marks it as handled:

<RepeatButton x:Name="bob" PreviewMouseLeftButtonUp="bob_MouseUp" >
   Repeatinator!!
</RepeatButton>
like image 128
J Cooper Avatar answered Apr 04 '26 09:04

J Cooper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!