wpftouchright-clickwindows-xp-embedded

Disable a right click (press and hold) in WPF application.


I am working on the touch screen application which is running on Windows XP Standard. With current hardware to invoke a right click user has to click and hold for couple of seconds, but this might interfere with other actions like holding a repeat button in the scrollviewer, so I have decide to disable a right click.

I would ideally wan't to disable a right click on the application level, but if it is not possible, disable right click on windows level would also work for me.


Solution

  • You can override the OnPreviewMouseRightButtonDown on the Window and set Handled to true. You also need to handle OnPreviewMouseRightButtonUp (thanks to Vitalij for pointing this out)

    That should do the trick.