Is there an equivalent to Javascript's event.preventDefault() in C# (using wpf)?
I want to prevent the default behavior when left clicking anywhere in the screen.
private void Button_MouseDown(object sender, MouseButtonEventArgs e){
// I want to use something like Javascript's e.preventDefault()
}
You might want to try e.Handled = true like so:
private void Button_MouseDown(object sender, MouseButtonEventArgs e){
e.Handled = true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With