How does the Button_Click event determine which mouse button was pressed? I tried to use the tips given in the Question question , but they did not help:
MouseEventArgs me = (MouseEventArgs) e; Failed to cast object type "System.Windows.RoutedEventArgs" to type "System.Windows.Input.MouseEventArgs". And when using this:
if (SystemParameters.SwapButtons) { // тут код } else { // тут код } only the left mouse button worked, nothing happened when the right button was clicked. So how can we programmatically determine inside the OnClick event of a button, which of the mouse buttons was pressed?