I have a winform code to suppress a keypress. Here it is
if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Left || e.KeyCode == Keys.Delete) {
e.SuppressKeyPress = true;
}
I want the same thing in UWP and tried this
if (e.Key == Windows.System.VirtualKey.Up || e.Key == Windows.System.VirtualKey.Down || e.Key == Windows.System.VirtualKey.Delete) {
e.SuppressKeyPress = true;
}
But its giving me an error 'KeyRoutedEventArgs' does not contain a definition for 'SuppressKeyPress' and no accessible extension method 'SuppressKeyPress' accepting a first argument of type 'KeyRoutedEventArgs' could be found (are you missing a using directive or an assembly reference?
You can block other handlers from processing that event by marking it as handled: