WPF RepeatButton MouseUp

Is there a way to get MouseUpevent on the re-launch button to fire when the button is no longer pressed? I am trying to use the MouseMove event to track the position of a mouse when a button is clicked, but neither MouseDown nor MouseUp fire an event for the left mouse button. Any ideas or tips on what you can do? Thanks you

+3
source share
2 answers

The repeat button appears to mark the event as internal. You can use the PreviewMouseLeftButtonUp tunneling event to catch the event before RepeatButton marks it as processed:

<RepeatButton x:Name="bob" PreviewMouseLeftButtonUp="bob_MouseUp" >
   Repeatinator!!
</RepeatButton>
+2
source

, , - true mousemove.

private void mouseMove(object sender, MouseEventArgs e)
{
//do everything you need to, then add this line at the end
e.Handled = true;
}

previewMouseButton.

0

All Articles