Wpf: Why MouseDown event doesn't work for LMB?

Created on 19 Jul 2020  路  2Comments  路  Source: dotnet/wpf

Why MouseDown event doesn't work for LMB? When I click my button via LMB nothing happens but everything works as expected for MMB and RMB.

Most helpful comment

The critical information here is that the affected element is a _button_.

This is by design. The Button handles the event itself to fire the Click event when appropriate. If you want to handle the MouseLeftButtonDown, use the preview event as documented.

All 2 comments

The critical information here is that the affected element is a _button_.

This is by design. The Button handles the event itself to fire the Click event when appropriate. If you want to handle the MouseLeftButtonDown, use the preview event as documented.

Thanks, @miloush. @Alvin-Seville, thanks for opening the issue. Please reactivate if the answer is insufficient.

Was this page helpful?
0 / 5 - 0 ratings