简体   繁体   中英

Enable press and hold for right-clicking with

I'm working with a WPF application.This application runs on a pc with a touch screen and when I push one button for more than 3 seconds MyButton_PreviewMouseUp event occurs and after that occurs a MyButtonSimple_PreviewMouseRightButtonDown event. I need to disable something for disabling the function of windows that do this.

You are not describing the default behaviour of a Button . In a normal WPF application, the PreviewMouseUp event occurs only when a pressed mouse button is let go. You can easily prove this yourself by adding a Button to a new WPF application and attaching a handler to the PreviewMouseUp event. You will see that it is only raised when you lift your finger off a pressed mouse button.

So this means that it is your code that is causing that behaviour and as you haven't shown us the relevant section (or indeed any code), we cannot help you with this further. I suggest searching your application for PreviewMouseUp to see if this event is being manually raised anywhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM