I have a button that I trigger OnClick
whenever there is a click on that button. I would like to know which Mouse button clicked on that button?
When I use the Mouse.LeftButton
or Mouse.RightButton
, both tell me "realsed" which is their states after the click.
I just want to know which one clicked on my button. If I change EventArgs
to MouseEventArgs
, I receive errors.
XAML: <Button Name="myButton" Click="OnClick">
private void OnClick(object sender, EventArgs e)
{
//do certain thing.
}